Do both the function return the same value?
<?php
echo "<br>".strstr("this is a test", "s");
echo "<br>".strchr("this is a test", "s");
?>
Is there any difference that i can't see?
Do both the function return the same value?
<?php
echo "<br>".strstr("this is a test", "s");
echo "<br>".strchr("this is a test", "s");
?>
Is there any difference that i can't see?
strstr — Find the first occurrence of a string
This function is an alias of: strstr().
So, for your Question, the answer is "BOTH ARE SAME"
You used strstr()
which is an alias of strchr()
, that's why it is just the same. But your reference compares strchr()
and strrchr()
, that's why you get a different result than from your reference
EDIT
Since you've edited your question. This is now my answer:
You used strstr()
which is just an alias of strchr()
, that's why it is just the same.