Simple array code seems to break .. [message #175471] |
Fri, 30 September 2011 16:13 |
user
Messages: 1 Registered: September 2011
Karma: 0
|
Junior Member |
|
|
Hi, i'm just starting with php, and i have a problem that i just cant
solve oO
I a web page i have a scipt
<? php
$x = array("a"=>"b","b"=>1);
?>
which produces an output of
"b","b"=>1); ?>
So, it pretty much stops counting as a script at the =>
And i just don't get why..
|
|
|
Re: Simple array code seems to break .. [message #175472 is a reply to message #175471] |
Fri, 30 September 2011 16:35 |
Peter H. Coffin
Messages: 245 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
On Fri, 30 Sep 2011 18:13:19 +0200, user(at)domain(dot)invalid wrote:
> Hi, i'm just starting with php, and i have a problem that i just cant
> solve oO
>
> I a web page i have a scipt
>
> <? php
> $x = array("a"=>"b","b"=>1);
> ?>
>
> which produces an output of
> "b","b"=>1); ?>
>
> So, it pretty much stops counting as a script at the =>
>
> And i just don't get why..
Turn off short tags, remove the space between <? and php, try it again.
--
A way of life that is odd or even erratic but interferes with no rights
or interests of others is not to be condemned because it is different.
-- Chief Justice Warren E. Burger
|
|
|
Re: Simple array code seems to break .. [message #175473 is a reply to message #175472] |
Fri, 30 September 2011 17:10 |
Jessica Streicher
Messages: 1 Registered: September 2011
Karma: 0
|
Junior Member |
|
|
Thanks.. removing the space worked.
I swear i tried that before... and it did not..
*grumbles*
Such a stupid thing..
On 30.09.2011 18:35, Peter H. Coffin wrote:
> On Fri, 30 Sep 2011 18:13:19 +0200, user(at)domain(dot)invalid wrote:
>> Hi, i'm just starting with php, and i have a problem that i just cant
>> solve oO
>>
>> I a web page i have a scipt
>>
>> <? php
>> $x = array("a"=>"b","b"=>1);
>> ?>
>>
>> which produces an output of
>> "b","b"=>1); ?>
>>
>> So, it pretty much stops counting as a script at the =>
>>
>> And i just don't get why..
>
> Turn off short tags, remove the space between<? and php, try it again.
>
|
|
|