Get support from Xavier Media
It is currently Sun Dec 08, 2013 12:24 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: more trouble with arrays:
PostPosted: Sat Dec 06, 2008 9:28 pm 
Offline
Rookie (I'm probably spamming)
Rookie (I'm probably spamming)

Joined: Tue Dec 02, 2008 2:01 pm
Posts: 5
Points: 0
this is the error code i'm getting:
Parse error: syntax error, unexpected '[' in C:\wamp\www\DWC_Remote\arraynum2.php on line 3

here's my code ... i'm trying a variation of one of ur tutorials.:
Code:
<?php
$nums = array("2", "4", "5");
print_r($nums [2]*[1]);
?>

i know its a simple error but knowledge of php is rudimentary as u can see and tell.


Report this post
Top
 Profile Send private message E-mail  
Reply with quote  
 Post subject: Re: more trouble with arrays:
PostPosted: Sun Dec 07, 2008 7:24 am 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
By changing the code to this it will work:
PHP Code:
<?php
$nums = array("2", "4", "5");
print_r($nums[2]*$nums[1]);
?>

_________________
Xavier Media®
Join me at LinkedIn | Get your latest blog post in your signature you too


Report this post
Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: more trouble with arrays:
PostPosted: Sun Dec 07, 2008 6:01 pm 
Offline
Rookie (I'm probably spamming)
Rookie (I'm probably spamming)

Joined: Tue Dec 02, 2008 2:01 pm
Posts: 5
Points: 0
thank you very much. i will keep on trying new code with php and doing your tutorials with a mix. i knew it was a simple fix. :D


Report this post
Top
 Profile Send private message E-mail  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Registered users: No registered users


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Portal » Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[
SEO MOD © 2007 StarTrekGuide ]