reference/strings/functions/strstr.xml
45042fef652f1b4e904e809fcbfcf31f6c60670b
...
...
@@ -27,9 +27,9 @@
27
27
</note>
28
28
<note>
29
29
<para>
30
-
If you only want to determine if a particular <parameter>needle</parameter>
31
-
occurs within <parameter>haystack</parameter>, use the faster and less memory
32
-
intensive function <function>strpos</function> instead.
30
+
If it is only required to determine if a particular <parameter>needle</parameter>
31
+
occurs within <parameter>haystack</parameter>, the faster and less memory
32
+
intensive <function>str_contains</function> function should be used instead.
33
33
</para>
34
34
</note>
35
35
</refsect1>
...
...
@@ -118,10 +118,10 @@
118
118
<?php
119
119
$email = 'name@example.com';
120
120
$domain = strstr($email, '@');
121
-
echo $domain; // prints @example.com
121
+
echo $domain, PHP_EOL; // prints @example.com
122
122

123
123
$user = strstr($email, '@', true);
124
-
echo $user; // prints name
124
+
echo $user, PHP_EOL; // prints name
125
125
?>
126
126
]]>
127
127
</programlisting>
128
128