Does anyone know of a string function to extract a string from another string.
Looked in man and all i could find was strpos to locate the position of start of string.
Ta Craig.
These functions will do the trick: strstr(),strchr(),strrchr, and stristr(). http://www.php.net/manual/en/function.strstr.php
$source = "abcd"; $result = substr( $source, 1,2 );
echo "result=$result";
result=bc