لغة PHP — الصفحة ٢١٢

الفصل السادس http://localhost/test/p7/new22 - Microsof. X File Edit View Favorites Tools Help Back Forwar Stop Refresh Home Address http://localhost/test/p7/new22 Go Links" mary had a little lamb and she loved it so All capital: MARY HAD A LITTLE LAMB AND SHE LOVED IT SO 1 Done Local intranet $trans = array ("hello" => "hi", "hi" => "hello"); echo strtr("hi all, I said hello", $trans) . "\n"; http://localhost/test/p7/new23-M O File Edit View Favorites Tools Help Xx Stop Refresh Home Back Address Forward http://localhost/test/p7 hello all, I said hi Done Local intranet Go Links // string substr (string string, int start [, int length]) $rest = substr("abcdef", 1); // returns "bcdef" $rest substr ("abcdef", 1, 3); // returns "bcd" $rest $rest $rest $rest = = - substr ("abcdef", -1); // returns "f" substr ("abcdef", -2); // returns "ef" substr ("abcdef", -3, 1); // returns "d" substr ("abcdef", 1, -1); // returns "bcde" // Example substr_count() example print substr_count("This is a test", "is"); // prints out 2 //Substr_replace() example $var = 'ABCDEFGH:/MNRPQR/'; echo "Original: $var<hr>\n"; متنوعات ۲۱۲
ص ٢١٢

النص مستخرج آليًّا من صور الكتاب، وقد يقع فيه خطأ.