$un = ""; $un .= "un";
echo strlen("un"); // 2
Remove leadin or trailing whitespace.
echo "A" .trim(" B C D ") . "E"; // "AB C DE"
Retourne le string recherché et tout ce qui suit.
$str = "vamos a la playa"; echo strstr($str, "la"); // "la playa" echo strstr($str, "yolo"); // rien
$str = "vamos a la playa"; echo str_replace("la playa", "bailar la bamba", $str); // vamos a bailar la bamba
$str = "go ! "; echo str_repeat($str, 3); // "go ! go ! go ! "
$str = "0123456789"; echo substr($str, 1,8); // "12345678";
$str = "0123456789"; echo strpos($str, "234"); // 2
$str = "0123456789"; echo strchr($str, "8"); // "89" echo strchr($str, "a"); // rien $str = "abba"; echo strchr($str, "a"); // "abba" $str = "gabba"; echo strchr($str, "a"); // "abba"