|
Posted by comatose on 02/01/07 22:22
On Thu, 01 Feb 2007 23:13:08 +0100, "J.O. Aho" <user@example.net> wrote:
>comatose wrote:
>> If i have a string like this "1234,567.89"
>> how can i explode at the COMMA and the PERIOD to get
>> $string[0]=1234
>> $string[1]=567
>> $string[2]=89
>
>This works, but not really best option:
>$string=explode('.',ereg_replace(',','.',"1234,567.89"));
>
>Bit unsure about this one:
>$string=preg_split("/[,.]/","1234,567.89");
Neither of them worked.
Navigation:
[Reply to this message]
|