results in array or something else..

Hi there,

I have a result coming from external website. The result is like this:

OK:0001:0.018:4490123;OK:0002:0.018:4412333;OK:0012:0.025:44903121231;

The separator of this result is “;” .

So the result should be like this:

OK:0001:0.018:4490123
OK:0002:0.018:4412333
OK:0012:0.025:44903121231

How can I get the results like above?

Thank you.

Hi again,

After a quick search I found a solution like this:

$result = “OK:0001:0.018:4490123;OK:0002:0.018:4412333;OK:0012:0.025:44903121231;”;

$res = split(’;’,$result);

foreach ($res AS $s) {
    list($part1, $part2, $part3, $part4= explode(":", $s);
    echo $part4."<br />";
}

result is:
4490123
4412333
44903121231

:slight_smile: :wink: :smiley: ;D :o :stuck_out_tongue:

Sponsor our Newsletter | Privacy Policy | Terms of Service