PHP strstr function 

This function in PHP takes a string  and a token as an Input and it outputs the part of the string before the occurrence of the token.

For example

Let’s say there is a string 

$word=”Handle”

and we have a token ‘l’

Then strstr ($word, ‘l’,true); would return “Hand” as the output.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s