Source Code:
(back to article)
<?php $string = "The quick brown fox jumps over the lazy dog."; $substring = "brown"; if (($result = stristr($string, $substring)) !== false) { echo "The substring '$substring' was found in the string '$string' and the resulting string is '$result'"; } else { echo "The substring '$substring' was not found in the string '$string'"; }
Result:
Report an issue