Last active
May 16, 2019 17:51
-
-
Save flaviors200/e1b51a45c1b312cfbead1cdb7bf9297a to your computer and use it in GitHub Desktop.
String functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$string = "Ciao mondo!"; | |
echo strlen($string)."\n"; // Output 11 | |
echo strpos($string, 'mondo')."\n"; // Output 5 | |
echo substr($string, 5, 5)."\n"; // Output mondo | |
echo str_replace('mondo', 'a tutti', $string)."\n"; // Output Ciao a tutti |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment