diff --git a/reference/strings/functions/explode.xml b/reference/strings/functions/explode.xml index 97b407e4..28800c86 100644 --- a/reference/strings/functions/explode.xml +++ b/reference/strings/functions/explode.xml @@ -1,5 +1,5 @@ - + explode @@ -127,15 +127,14 @@ // 1. örnek $pizza = "dilim1 dilim2 dilim3 dilim4 dilim5 dilim6"; $dilimler = explode(" ", $pizza); -echo $dilimler[0]; // dilim1 -echo $dilimler[1]; // dilim2 +echo $dilimler[0], PHP_EOL; // dilim1 +echo $dilimler[1], PHP_EOL; // dilim2 // 2. örnek $data = "foo:*:1023:1000::/home/foo:/bin/sh"; list($user, $pass, $uid, $gid, $gecos, $home, $shell) = explode(":", $data); -echo $user; // foo -echo $pass; // * - +echo $user, PHP_EOL; // foo +echo $pass, PHP_EOL; // * ?> ]]> diff --git a/reference/strings/functions/htmlentities.xml b/reference/strings/functions/htmlentities.xml index 8ecef1c8..91cbe9df 100644 --- a/reference/strings/functions/htmlentities.xml +++ b/reference/strings/functions/htmlentities.xml @@ -1,5 +1,5 @@ - + htmlentities @@ -205,14 +205,20 @@ Tek bir 'tırnak'"; -// Çıktısı: <b>Tek</b> bir 'tırnak' echo htmlentities($str); - -// Çıktısı: <b>Tek</b> bir 'quote' -echo htmlentities($str, ENT_QUOTES); +echo "\n\n"; +echo htmlentities($str, ENT_COMPAT); ?> ]]> + &example.outputs; + + + diff --git a/reference/strings/functions/printf.xml b/reference/strings/functions/printf.xml index 7c94402c..6dfca93b 100644 --- a/reference/strings/functions/printf.xml +++ b/reference/strings/functions/printf.xml @@ -1,5 +1,5 @@ - + printf diff --git a/reference/strings/functions/str-replace.xml b/reference/strings/functions/str-replace.xml index b53eed08..38f930e2 100644 --- a/reference/strings/functions/str-replace.xml +++ b/reference/strings/functions/str-replace.xml @@ -1,5 +1,5 @@ - + str_replace @@ -103,10 +103,12 @@ $bodytag = str_replace("%body%", "black", ""); +echo $bodytag, PHP_EOL; // Sonuç: Hll Wrld f PHP $vowels = array("a", "e", "i", "o", "u", "A", "E", "I", "O", "U"); $onlyconsonants = str_replace($vowels, "", "Hello World of PHP"); +echo $onlyconsonants, PHP_EOL; // Sonuç: You should eat pizza, beer, and ice cream every day $phrase = "You should eat fruits, vegetables, and fiber every day."; @@ -114,10 +116,11 @@ $healthy = array("fruits", "vegetables", "fiber"); $yummy = array("pizza", "beer", "ice cream"); $newphrase = str_replace($healthy, $yummy, $phrase); +echo $newphrase, PHP_EOL; // sağlanan: 2 $str = str_replace("ll", "", "good golly miss molly!", $count); -echo $count; +echo $count, PHP_EOL; ?> ]]> @@ -137,6 +140,7 @@ $replace = '
'; // \r\n'ler önce değiştirilmeli ki tekrar değiştirilmesin $newstr = str_replace($order, $replace, $str); +echo $newstr, PHP_EOL; // F çıktılanır, çünkü A ile B, B ile C, ... yer değiştirir. // Yer değiştirme soldan sağa doğru yapıldığından @@ -144,7 +148,7 @@ $newstr = str_replace($order, $replace, $str); $search = array('A', 'B', 'C', 'D', 'E'); $replace = array('B', 'C', 'D', 'E', 'F'); $subject = 'A'; -echo str_replace($search, $replace, $subject); +echo str_replace($search, $replace, $subject), PHP_EOL; // Çıktısı: apearpearle pear // yukarda bahsedilen sebeple @@ -152,7 +156,7 @@ $letters = array('a', 'p'); $fruit = array('apple', 'pear'); $text = 'a p'; $output = str_replace($letters, $fruit, $text); -echo $output; +echo $output, PHP_EOL; ?> ]]>