I'm trying to work with a line of text that comes in the format:
Code: Select all
13:14 692 405 3 339 29619 28 66 7426 5677 405 269 299 405 393 27 29631 714Code: Select all
for ($i=0; $i <= 4; $i++)
{
$time = $time . $result[$i];
}thanks,
noon
Moderator: General Moderators
Code: Select all
13:14 692 405 3 339 29619 28 66 7426 5677 405 269 299 405 393 27 29631 714Code: Select all
for ($i=0; $i <= 4; $i++)
{
$time = $time . $result[$i];
}Code: Select all
$result = '13:14 692 405 3 339 29619 28 66 7426 5677 405 269 299 405 393 27 29631 714';
$time = substr($result, 0, 5);
$ints = substr($result, 6, strlen($result));
$ints = explode(' ', $ints);
echo 'Time: '. $time;
echo '<pre>';
print_r($ints);Code: Select all
$weather = explode(' ', $result);yesnoon wrote:Heh, I just found the explode function.
Couldn't I just use:Space being the delimiter, and $result[0] being time, and etc.?Code: Select all
$weather = explode(' ', $result);