Hàm print() trong PHP - PHP Function
Code print("Zaidap.com.net") . "<br />"; print "print() vẫn hoạt động khi không sử dụng dấu ngoặc đơn." . "<br />"; print "print() vẫn hoạt động khi in nhiều dòng" . "<br />";
Hàm rtrim() trong PHP - PHP Function
Code $str1 = "Zaidap.com.net--------"; $str2 = "Zaidap.com.net999999"; echo $str1 . "<br />"; echo $str2 . "<br />"; echo rtrim($str1, "-") . "<br />"; echo rtrim($str2, "9") . "<br />";
Hàm similar_text() trong PHP - PHP Function
Code $var_1 = 'this is a string'; $var_2 = 'second string'; echo similar_text($var_1, $var_2, $percent) . "<br />"; echo $percent;
Hàm str_ireplace() trong PHP - PHP Function
$search và $replace là các chuỗi. Code $search = 'an example'; $replace = 'a note'; $subject = 'this is an example string'; $result = str_ireplace($search, $replace, $subject); echo $subject . "<br />"; echo $result . "<br />"; ...
Hàm str_pad() trong PHP - PHP Function
Code $input = "Zaidap.com.net"; echo str_pad($input, 20) ."<br />"; echo str_pad($input, 20, "-=", STR_PAD_LEFT) ."<br />"; echo str_pad($input, 20, "_", STR_PAD_BOTH) ."<br />"; echo str_pad($input, 13, "___") ."<br />"; ...
Hàm str_repeat() trong PHP - PHP Function
Code $input = "Free-"; $result = str_repeat($input, 3); echo $result;
Hàm str_shuffle() trong PHP - PHP Function
Code $input = "Zaidap.com.net"; $result = str_shuffle($input); echo $input . "<br />"; echo $result;
Hàm str_split() trong PHP - PHP Function
Code $input = "Zaidap.com.net";<br /> $result = str_split($input);<br /> $result_2 = str_split($input, 3);<br /> echo "<pre>";<br /> print_r($result);<br /> echo "</pre>";<br /> <br /> echo "<pre>";<br /> ...
Hàm str_word_count() trong PHP - PHP Function
Code $input = "Zaidap.com.net duoc sang lap b0i anh Nguyen Van Cu0ng"; $result = str_word_count($input); $result_2 = str_word_count($input, 1); $result_3 = str_word_count($input, 2); echo "<pre>"; print_r($result); echo "</pre>"; echo "<pre>"; print_r($resu ...
Hàm strcasecmp() trong PHP - PHP Function
Code $var1 = "Zaidap.com.net";<br /> $var2 = "Zaidap.com.net";<br /> if (strcasecmp($var1, $var2) == 0) {<br /> echo "hai chuỗi giống nhau";<br /> } Kết quả hai chuỗi giống nhau
Hàm strchr() trong PHP - PHP Function
Code $var = "something@Free@tuts.net"; $result = strchr($var, "@"); $result_2 = strchr($var, "@", true); echo $result . "<br />"; echo $result_2;
Hàm strstr() trong PHP - PHP Function
Code $var = "something@Free@tuts.net"; $result = strstr($var, "@"); $result_2 = strstr($var, "@", true); echo $result . "<br />"; echo $result_2;
Hàm strcmp() trong PHP - PHP Function
Code $var1 = "Zaidap.com.net"; $var2 = "Zaidap.com.net"; if (strcmp($var1, $var2) == 0) { echo "hai chuỗi giống nhau <br />"; }else{ echo "hai chuỗi không giống nhau <br />"; } Kết quả hai chuỗi không giống nhau
Hàm strip_tags() trong PHP - PHP Function
Code $str = 'This is a <b> Example</b> <a href="#fragment">String</a> <p>this a other string</p>'; echo $str; echo strip_tags($str) . "<br />"; Kết quả This is a Example String this a other ...
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);