Mega Code Archive

 
Categories / Php / Strings
 

Strstr function demo

<?php     $haystack = 'is a test';     $pos = strstr ($haystack, 'is');     if (!$pos)       echo "String not found\n";     else       echo "String found: $pos\n"; ?>