FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Simple array code seems to break ..
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Simple array code seems to break .. [message #175471] Fri, 30 September 2011 16:13 Go to next message
user is currently offline  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 Go to previous messageGo to next message
Peter H. Coffin is currently offline  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 Go to previous message
Jessica Streicher is currently offline  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.
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: cURL and MultiPowUpload
Next Topic: Contact Form
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 22:59:07 GMT 2024

Total time taken to generate the page: 0.02378 seconds