$numberedString = "1234567890"; // 10 numbers from 1 to 0

$fivePos = strpos($numberedString, "5");

echo "The position of 5 in our string was $fivePos";

output

The position of 5 in our string was 4

 

 

Tagged with:

Filed under: PHP

Like this post? Subscribe to my RSS feed and get loads more!