Skip to content

Instantly share code, notes, and snippets.

@flaviors200
Last active May 16, 2019 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flaviors200/e1b51a45c1b312cfbead1cdb7bf9297a to your computer and use it in GitHub Desktop.
Save flaviors200/e1b51a45c1b312cfbead1cdb7bf9297a to your computer and use it in GitHub Desktop.
String functions
<?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