Articles → PHP → Strpos Function In PHPStrpos Function In PHPIn this article, we will discuss the "strpos" function in PHP.Purpose The strpos function returns the position of the first occurrence of the word in a string.Example <!DOCTYPE html> <html> <body> <?php echo "The position of first instance of had is at:".strpos("i had had my lunch","had"); ?> </body> </html>Output Click to EnlargePosted By - Karan Gupta Posted On - Tuesday, October 13, 2020 Query/Feedback Your Email Id** Subject* Query/Feedback Characters remaining 250**
<!DOCTYPE html> <html> <body> <?php echo "The position of first instance of had is at:".strpos("i had had my lunch","had"); ?> </body> </html>
Query/Feedback