You don't need a character class here (signified by [] brackets); you can use
$line = split('&|//', $field);
As you can see, this is identical to ReDucTor's solution, except that
the brackets are omitted. Character classes only work for single
characters, not multiple character strings
Thanks that helped, this is what I used:
if (ereg("&", $field)) $line = explode("&", $field);
else $line = explode("//", $field);
On Thu, 5 Jul 2001 05:29:11
ReDucTor wrote:
>$line2 = explode("", $field);
>for($i = 0; $i < sizeof($line2); $i++){
> if($line2[$i] == "&")
> $useand = 1;
>
Thanks for replying ReDucTor but that didn't work either. I tried
$line = explode("[(&|//)]", $field); and
$line = explode("[(&|)]", $field); and
$line = explode("[(&|\/\/)]", $field);
with no success. Any other ideas?
On Thu, 5 Jul 2001 04:50:29
ReDucTor wrote:
>$line = explode("[(&|//)]
$line = explode("[(&|//)]",$field); should work, or you might have to put
but thats not \ so you shouldn't need to comment out the slash...
- Original Message -
From: David A Dickson <[EMAIL PROTECTED]>
To: php-general <[EMAIL PROTECTED]>
Sent: Thursday, July 05, 2001 4:37 AM
Subject:
4 matches
Mail list logo