
Hàm stripcslashes() trong PHP - PHP Function
Code $str = 'this is a "test"'; echo $str . "<br />"; echo stripcslashes($str);

Hàm stripos() trong PHP - PHP Function
Code $str = 'this is my string'; echo stripos($str, "is"). "<br />"; echo stripos($str, "Is");

Hàm stripslashes() trong PHP - PHP Function
Code $str = 'this is a "test"'; echo $str . "<br />"; echo stripslashes($str);

Hàm stristr() trong PHP - PHP Function
Code $var = "something@Free@tuts.net"; $result = stristr($var, "@f"); $result_2 = stristr($var, "@f", true); echo $result . "<br />"; echo $result_2;

Hàm strlen() trong PHP - PHP Function
Code $str = "Zaidap.com.net"; $str_2 = " Zaidap.com.net "; $result = strlen($str); $result_2 = strlen($str_2); echo $result . "<br />"; echo $result_2;

Hàm strnatcasecmp() trong PHP - PHP Function
Code $str1 = "FREETUTS.net"; $str2 = "Zaidap.com.net"; $result = strnatcasecmp($str1, $str2); echo $result . "<br />"; echo strcmp($str1, $str2);

Hàm strnatcmp() trong PHP - PHP Function
Code $str1 = "FREETUTS.net"; $str2 = "Zaidap.com.net"; $result = strnatcmp($str1, $str2); echo $result . "<br />"; echo strnatcasecmp($str1, $str2);

Hàm strncmp() trong PHP - PHP Function
Code $str1 = "Zaidap.com.net"; $str2 = "Zaidap.com"; $result = strncmp($str1, $str2, 4); echo $result . "<br />"; echo strcmp($str1, $str2); Kết quả 0 4

Hàm strpbrk() trong PHP - PHP Function
Code $str = "this is Zaidap.com.net"; $result = strpbrk($str, 'fh'); echo $result; Kết quả his is Zaidap.com.net Chuỗi trả về bắt đầu từ vị trí đầu tiên tìm thấy ( vị trí của kí tự h) và kéo dài đến hết chuỗi nguồn.

Hàm strpos() trong PHP - PHP Function
Code $str = 'abcdefghimk'; $pos = strpos($str, 'd'); echo $pos; Kết quả 3

Hàm strrchr() trong PHP - PHP Function
Code $str = 'this a test string'; $result = strrchr($str, 's'); if ($result == false) { echo "kí tự không tồn tại trong chuỗi"; }else{ echo $result; } Kết quả string

Hàm strrev() trong PHP - PHP Function
Code echo strrev('this is a test') . "<br />"; echo strrev('Zaidap.com.net') . "<br />"; echo strrev('hello world') . "<br />"; echo strrev('this is my example') . "<br />";

Hàm strripos() trong PHP - PHP Function
Code $str = 'this is my string'; echo strpos($str, "is"). "<br />"; echo strripos($str, "Is"); Kết quả 2 5

Hàm strrpos() trong PHP - PHP Function
Code $str = 'this is my string'; if (strrpos($str, "is") == false) { echo "chuỗi 'is' không tồn tại trong chuỗi nguồn!<br />"; }else{ echo strrpos($str, "is"). "<br />"; } if (strrpos($str, "Is") == false) { echo "chuỗi 'Is' không tồn tại trong chuỗi ...

Hàm strspn() trong PHP - PHP Function
Code $str = "abcd efgh iklm"; echo strspn($str, 'ab') . "<br />"; echo strspn($str, 'abcd') . "<br />"; echo strspn($str, 'abcd', 2) . "<br />"; echo strspn($str, 'abcd', 0, 2) . "<br />";

Hàm strtok() trong PHP - PHP Function
Code $string = "This is an example string"; echo strtok($string, "an") . "<br />"; echo strtok($string, "s") . "<br />"; echo strtok($string, "z") . "<br />"; Kết quả This is <br>Thi<br>This is an example string

Hàm strtolower() trong PHP - PHP Function
Code $string = "This is An EXAMPLE String"; $result = strtolower($string); echo $result;

Hàm strtoupper() trong PHP - PHP Function
<?php echo strtoupper('Welcome To Zaidap.com.net'); // WELCOME TO FREETUTS.NET ?>

Hàm strtr() trong PHP - PHP Function
Hàm strtr() sử dụng 3 tham số: Code $string = "This is an example String"; $result = strtr($string, "i", "a"); echo $result; Kết quả Thas as an example Strang

Hàm substr_compare() trong PHP - PHP Function
Code echo substr_compare("abcde", "bc", 1, 2) . '<br>'; // 0 echo substr_compare("abcde", "de", -2, 2) . '<br>'; // 0 echo substr_compare("abcde", "bcg", 1, 2) . '<br>'; // 0 echo substr_compare("abcde", "BC", 1, 2, true) . '<br>'; // 0 echo ...