Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP
Author Message
Bigboy177
Worker
Worker



Joined: Jul 07, 2004
Posts: 192

PostPosted: Wed Nov 16, 2005 7:05 pm Reply with quote

Hi...

I've got a little problem with the array and variables... I want an array to be dynamic... That means I need to have something like this:

array($var);

but it doesn't work... Of course $var is declared above like this:

$var = "1,2,3";

Why doesn't it work...? It shows the whole array not just the first, second or third number...

_________________
Gry Online 
View user's profile Send private message
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6432

PostPosted: Wed Nov 16, 2005 9:58 pm Reply with quote

In this instance, $var is not properly defined as an array, but rather as a string. Check this for clarification: [ Only registered users can see links on this board! Get registered or login! ]

Here's another option for converting a string into an array: [ Only registered users can see links on this board! Get registered or login! ]

Make sure you read the user-contributed notes at the bottom of the pages on php.net - you can often find great examples and useful tools, utilities, functions, ideas, etc. there.

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
Bigboy177







PostPosted: Thu Nov 17, 2005 6:13 am Reply with quote

Thanks... I forgot about the explode function... hehe

Now it works great... Smile

Thanks again...
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> PHP

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©