PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Mon Nov 08, 2004 2:42 am
i a mreciving an error o nthis array structure why?
Code: Select all
<?php
<?
$archivos=Array
( Array(["index"] => 0, ["name"] => "test")
,
Array(["index"] => 0, ["name"] => "watertaxi.jpg" )
,
Array(["index"] => 0, ["name"] => "2_0003.JPG" )
,
Array( ["index"] => 0, ["name"] => "24A_0025.JPG" )
, Array
( ["index"] => 1,["name"] => "_CIMG3501.JPG" )
)
?>
?>
phpScott
DevNet Resident
Posts: 1206 Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.
Post
by phpScott » Mon Nov 08, 2004 2:51 am
what's the error message?
AnarKy
Forum Contributor
Posts: 119 Joined: Tue Nov 02, 2004 1:49 am
Location: South Africa
Post
by AnarKy » Mon Nov 08, 2004 2:52 am
What is the error?
Please give us the error message.
Perhaps say what it is you're trying to do?
There may be a better way for the declaration.
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Mon Nov 08, 2004 2:56 am
this is the new array :
Code: Select all
<?php
$fruits = array (
"fruits" => array("a" => "orange", "b" => "banana", "c" => "apple"),
"numbers" => array(1, 2, 3, 4, 5, 6),
"holes" => array("first", 5 => "second", "third")
)
echo print_r($fruits);
?>
and i recive the message :
Parse error: parse error, unexpected T_ECHO in C:\Program Files\Apache Group\Apache2\htdocs\test\sort.php on line
Crom
Forum Newbie
Posts: 8 Joined: Mon Nov 08, 2004 2:50 am
Location: Ukraine
Contact:
Post
by Crom » Mon Nov 08, 2004 4:42 am
Your array is ok
print_r outputs result itself. There is no need to put "echo" before it. Error is caused because you didn't put ";" after array declaration.
pelegk2
Forum Regular
Posts: 633 Joined: Thu Nov 27, 2003 5:02 am
Location: Israel - the best place to live in after heaven
Contact:
Post
by pelegk2 » Mon Nov 08, 2004 5:12 am
ow oppps my ,istake:)