PHP Return String Found At Position 22 – String Function

<?php    $haystack = 'this is a test. this is a test. this is a test';     $pos = strpos ($haystack, 'bottle');    if ($pos === false)
      echo "String not found\n";
    else
      echo "String found at position $pos\n";?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.