|
Posted by Jerry Stuckle on June 10, 2008, 6:13 am
Please log in for more thread options spreadbetting@gmail.com wrote:
> I'm trying to split a string into an separate arrays but the data is
> only delimited by a comma. The actual data is one long string but the
> info is in a regular format and repeats after every five ~'s .
>
>
> i.e the data may be returned as
>
>
> 1.01~11844.69~0.0~0.0~2.0~1.02~117.3~0.0~0.0~0.0~1.03~66.82~0.0~0.0~0.0~1.0
> 4~300.0~0.0~0.0~0.0~
>
>
> I guess I just have to loop through every five ~'s but unsure of the
> best way using php , with C# I guess I could use length but haven't
> too much of a clue using php. At the moment I'm even considering a
> dirty fix using preg_replace to change the delimiter every 5 ~'s but
> there must be a more correct way
>
>
> Thanks
>
Or explode() the string on '~' and take every 5 items and place them in
their own array.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
|