|
Posted by Justin Koivisto on 12/10/05 01:00
Sergei Riaguzov wrote:
> On Fri, 09 Dec 2005 16:39:25 -0600, Justin Koivisto wrote:
>
>
>>See the "cannot use "-" in variable names?" thread...
>
> What have variable names to keys of array?!
>
>
> $array["w t f"] = ...
> print_r($array);
>
> works nicely.
>
> But try the example in the first post.
PHP does allow free-form strings for array indicies, so that's perfectly
legal. I've never tried it (or heard anything to suggest otherwise), but
in theory, you could probably even use tabs, new lines, carriage
returns, etc. in the array index.
I'm wondering if it isn't PHP that does the conversion at all, but maybe
the web server software... I know when I first noticed that "-"
characters were being replaced I was using apache 1.3 (win & lin) with
php 4.x, but now I am using apache 2 (and php5), but I don't recall ever
finding documentation about this replacement stuff for either software.
--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com
[Back to original message]
|