Using Strings In PHP strstr

Using the strstr function in PHP

Now that we know how to find the position of a character or string inside a string, what if we wanted to know everything after that position? That is where the strstr function comes into play.

1. $string_one = “I saw a boy. His name is Brent.”;
2. $string_two = strstr($string_one, “His”);
3. print “$string_two”;
would print His name is Brent. This is useful for extracting data from a large entry.

Other functions for manipulating strings: