svn: /phpdoc/en/trunk/reference/json/functions/ json-decode.xml json-encode.xml json-last-error.xml

From: Date: Thu, 16 Jun 2011 12:57:06 +0000
Subject: svn: /phpdoc/en/trunk/reference/json/functions/ json-decode.xml json-encode.xml json-last-error.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-8279@lists.php.net to get a copy of this message
vrana Thu, 16 Jun 2011 12:57:06 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=312208 Log: Whitespace Changed paths: U phpdoc/en/trunk/reference/json/functions/json-decode.xml U phpdoc/en/trunk/reference/json/functions/json-encode.xml U phpdoc/en/trunk/reference/json/functions/json-last-error.xml Modified: phpdoc/en/trunk/reference/json/functions/json-decode.xml =================================================================== --- phpdoc/en/trunk/reference/json/functions/json-decode.xml 2011-06-16 12:55:11 UTC (rev 312207) +++ phpdoc/en/trunk/reference/json/functions/json-decode.xml 2011-06-16 12:57:06 UTC (rev 312208) @@ -194,10 +194,10 @@ } // Show the errors for different depths. -foreach(range(4, 3, -1) as $depth) { - var_dump(json_decode($json, True, $depth)); +foreach (range(4, 3, -1) as $depth) { + var_dump(json_decode($json, true, $depth)); echo 'Last error: ', $json_errors[json_last_error()], PHP_EOL, PHP_EOL; - } +} ?> ]]> </programlisting> Modified: phpdoc/en/trunk/reference/json/functions/json-encode.xml =================================================================== --- phpdoc/en/trunk/reference/json/functions/json-encode.xml 2011-06-16 12:55:11 UTC (rev 312207) +++ phpdoc/en/trunk/reference/json/functions/json-encode.xml 2011-06-16 12:57:06 UTC (rev 312208) @@ -97,7 +97,7 @@ <programlisting role="php"> <![CDATA[ <?php -$arr = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5); +$arr = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5); echo json_encode($arr); ?> @@ -119,11 +119,11 @@ $a = array('<foo>',"'bar'",'"baz"','&blong&'); echo "Normal: ", json_encode($a), "\n"; -echo "Tags: ", json_encode($a,JSON_HEX_TAG), "\n"; -echo "Apos: ", json_encode($a,JSON_HEX_APOS), "\n"; -echo "Quot: ", json_encode($a,JSON_HEX_QUOT), "\n"; -echo "Amp: ", json_encode($a,JSON_HEX_AMP), "\n"; -echo "All: ", json_encode($a,JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP), "\n\n"; +echo "Tags: ", json_encode($a, JSON_HEX_TAG), "\n"; +echo "Apos: ", json_encode($a, JSON_HEX_APOS), "\n"; +echo "Quot: ", json_encode($a, JSON_HEX_QUOT), "\n"; +echo "Amp: ", json_encode($a, JSON_HEX_AMP), "\n"; +echo "All: ", json_encode($a, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP), "\n\n"; $b = array(); Modified: phpdoc/en/trunk/reference/json/functions/json-last-error.xml =================================================================== --- phpdoc/en/trunk/reference/json/functions/json-last-error.xml 2011-06-16 12:55:11 UTC (rev 312207) +++ phpdoc/en/trunk/reference/json/functions/json-last-error.xml 2011-06-16 12:57:06 UTC (rev 312208) @@ -90,13 +90,11 @@ $json[] = "{'Organization': 'PHP Documentation Team'}"; -foreach($json as $string) -{ +foreach ($json as $string) { echo 'Decoding: ' . $string; json_decode($string); - switch(json_last_error()) - { + switch (json_last_error()) { case JSON_ERROR_NONE: echo ' - No errors'; break;

« previous php.doc.cvs (#8279) next »