|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2005-06-08 10:47 UTC] lars dot jensen at careercross dot com
Description: ------------ Certain Kanji direct in source seems to be a problem - wanted to use a small array for some simple language changes between english / japanese, but with these given kanji's it fail. Viewing the Kanji's as ascii, they both hold " in it, but closing the array strings using ', it shouldnt affect the strings. Example provided at http://www.ebenkyo.com/bug.php / Lars Reproduce code: --------------- As the code holds kanji characters, use this page to see the source. Please ensure to see the page using shift_jis encoding http://www.ebenkyo.com/bug_source.php Expected result: ---------------- The array not to fail with given Kanji's. Most Kanji sequences seem to work. Actual result: -------------- Parse error: parse error, unexpected T_STRING, expecting ')' in /usr/local/www/www.ebenkyo.com/bug.php on line 4 or similar PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 15:00:01 2025 UTC |
If that source is causing that error it's not because of the kanji sequences. You've got an extra comma (,) at the end of your array() statement. Your code: $foo = array ( 'One Text' => 'some kanji', 'Another Text' => 'more kanji', ); The last comma, should not be present, as PHP expects another argument to follow it. Simply remove it: $foo = array ( 'One Text' => 'some kanji', 'Another Text' => 'more kanji' ); On a related note, if you wish to code using non-western character sets, full Unicode support is being added into PHP5 (most likely, the next major release after 5.1 will have it). This should be of great use to you when it's released. Nicholas Telford