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: Mon Jun 06, 2005 12:48 pm Reply with quote

Hello to everyone...

I've got a problem with the function explode...

This is how my function looks like:
Code:


$zw = explode(",", $wg);


And here's the problem... It divides the variable but only when it looks like this...

Mom,dad,sister, <- I have to put the last ","...

it divides variable into:
1: Mom
2: dad
3: sister

If I don't put "," at the end...

Mom,dad,sister <- it doesn't divide the variable

it divides like this...
1: Mom
2: dad

There's not three...

Please help... Wink

_________________
Gry Online 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Mon Jun 06, 2005 1:57 pm Reply with quote

Something else is wrong, probably in your looping logic. If you try this script
Code:
<?

$txt = "Mom,dad,sister";
var_dump(explode(",",$txt));
?>

you will see that it returns all 3 results.

array(3) { [0]=> string(3) "Mom" [1]=> string(3) "dad" [2]=> string(6) "sister" }
 
View user's profile Send private message
Bigboy177







PostPosted: Mon Jun 06, 2005 2:18 pm Reply with quote

Yap... I found a mistake... Thanks for the reply... as always Smile
 
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 ©