Topic awaiting preservation: Explode() and foreach() help (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: under your rug, |
posted 09-29-2003 07:47
Ok i'm trying to explode a variable and check if another variable entry is in the first one. code: $incomming = explode(',', $variable1);
|
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 09-29-2003 08:49
This would be the one-line solution |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 09-29-2003 08:55
Ew, who was in charge of naming the function "explode" when it's always named "split" in every other language? |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 09-29-2003 09:22
Slime, PHP has both explode() and split() functions... The difference is that explode() splits a string by string while split() splits a string by regular expression. |
Paranoid (IV) Inmate From: under your rug, |
posted 09-29-2003 20:11
*Synthetic wounders when the last time he mentioned how much he loved mr.maX* |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 09-29-2003 20:37
OK then, that's not quite so bad =) |
Paranoid (IV) Inmate From: Milwaukee |
posted 10-01-2003 04:46
Also, "explode" is a much more entertaining mental image. |
Paranoid (IV) Inmate From: France |
posted 10-01-2003 12:39
The explode + in_array combo sounds obvious but I prefer by far mr.maX BTW2 suggestion. |