diff --git a/language/types/string.xml b/language/types/string.xml index 2a46bce839..ecce003a4f 100644 --- a/language/types/string.xml +++ b/language/types/string.xml @@ -1,5 +1,5 @@ - + Strings @@ -534,7 +534,7 @@ echo "This square is $square->{width}00 centimeters broad."; In fact, any value in the namespace can be included in a string with this syntax. Simply write the expression the same - way as it would appeared outside the string, and then wrap it + way as it would have appeared outside the string, and then wrap it in { and }. Since { can not be escaped, this syntax will only be recognised when the $ immediately follows the diff --git a/reference/array/functions/uasort.xml b/reference/array/functions/uasort.xml index 3c1b0f0983..3a7cecf0d0 100644 --- a/reference/array/functions/uasort.xml +++ b/reference/array/functions/uasort.xml @@ -1,10 +1,11 @@ - + uasort Sort an array with a user-defined comparison function and maintain index association + &reftitle.description; @@ -22,6 +23,7 @@ element order is significant. + &reftitle.parameters; @@ -46,12 +48,71 @@ + &reftitle.returnvalues; &return.success; + + + &reftitle.examples; + + + Basic <function>uasort</function> example + + 4, 'b' => 8, 'c' => -1, 'd' => -9, 'e' => 2, 'f' => 5, 'g' => 3, 'h' => -4); +print_r($array); + +// Sort and print the resulting array +uasort($array, 'cmp'); +print_r($array); +?> +]]> + + &example.outputs; + + 4 + [b] => 8 + [c] => -1 + [d] => -9 + [e] => 2 + [f] => 5 + [g] => 3 + [h] => -4 +) +Array +( + [d] => -9 + [h] => -4 + [c] => -1 + [e] => 2 + [g] => 3 + [a] => 4 + [f] => 5 + [b] => 8 +) +]]> + + + + + &reftitle.seealso; diff --git a/reference/datetime/datetimezone/construct.xml b/reference/datetime/datetimezone/construct.xml index 756f7809c2..b3a85ce2fa 100644 --- a/reference/datetime/datetimezone/construct.xml +++ b/reference/datetime/datetimezone/construct.xml @@ -1,5 +1,5 @@ - + @@ -33,6 +33,53 @@ + + + &reftitle.returnvalues; + + Returns DateTimeZone on success. + + + + + &reftitle.errors; + + This method throws Exception if the timezone supplied is not + recognised as a valid timezone. + + + + + &reftitle.examples; + + + Catching errors when instantiating <classname>DateTimeZone</classname> + +getMessage() . '
'; + } +} +?> +]]> +
+ &example.outputs; + + + +
+
+
diff --git a/reference/filesystem/functions/file-get-contents.xml b/reference/filesystem/functions/file-get-contents.xml index 1fe930d61f..5e4b6bea41 100644 --- a/reference/filesystem/functions/file-get-contents.xml +++ b/reference/filesystem/functions/file-get-contents.xml @@ -1,5 +1,5 @@ - + file_get_contents @@ -154,6 +154,76 @@ + + &reftitle.examples; + + + Get and output the source of the PHP.net homepage + + +]]> + + + + Searching within the include_path + + PHP 5 +$file = file_get_contents('./people.txt', FILE_USE_INCLUDE_PATH); +?> +]]> + + + + Reading a section of a file + + +]]> + + &example.outputs.similar; + + + + + + Using stream contexts + +array( + 'method'=>"GET", + 'header'=>"Accept-language: en\r\n" . + "Cookie: foo=bar\r\n" + ) +); + +$context = stream_context_create($opts); + +// Open the file using the HTTP headers set above +$file = file_get_contents('http://www.example.com/', false, $context); +?> +]]> + + + + + &reftitle.changelog; diff --git a/reference/filesystem/functions/file-put-contents.xml b/reference/filesystem/functions/file-put-contents.xml index 97d54479c2..8fac3b2d57 100644 --- a/reference/filesystem/functions/file-put-contents.xml +++ b/reference/filesystem/functions/file-put-contents.xml @@ -1,5 +1,5 @@ - + file_put_contents @@ -157,6 +157,68 @@ + + &reftitle.examples; + + + Simple usage example + + +]]> + + + + Using flags + + +]]> + + + + Using stream contexts + +array( + 'method'=>"GET", + 'header'=>"Accept-language: en\r\n" . + "Cookie: foo=bar\r\n" + ) +); + +$context = stream_context_create($opts); + +$person = "John Smith\n"; + +// Add content to the file using the HTTP headers set above +file_put_contents('people.txt', $person, NULL, $context); +?> +]]> + + + + + &reftitle.changelog; diff --git a/reference/info/functions/ini-set.xml b/reference/info/functions/ini-set.xml index 74dd11b109..6772912c6c 100644 --- a/reference/info/functions/ini-set.xml +++ b/reference/info/functions/ini-set.xml @@ -1,5 +1,5 @@ - + ini_set @@ -55,6 +55,28 @@ + + &reftitle.examples; + + + Setting an ini option + + +]]> + + + + + &reftitle.seealso;