php - String tags and rearranging order from output -
how go stripping away " -
, <b>
tags curl
output below? tried strip_tags
not know how rearrange order
<?php $ch = curl_init("http://beta.test123.com/archive.csv?s=blogs&f=lc1"); curl_setopt($ch, curlopt_header, 0); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_connecttimeout, 5); curl_exec($ch); curl_close($ch); ?>
curl output
"4:01pm - <b>n1234</b>",+0.50
trying achieve following format, outputted blog.inc file
n1234 +0.50 4:01 pm
$result = strip_tags($out); $result = str_replace(["- ", '"'], '', $result); // remove unnecessary chars $result = str_replace(',',' ', $result); // change comma space explode $array = explode(' ', $result); // explode space //here result - array needed values $array[1] // should n1234 $array[0] // should 4:01pm $array[2] // should +0.50
Comments
Post a Comment