Forum Moderators: coopster
$latestupdate1 = substr($latestupdate, 0, 109);
$latestupdate2 = substr($latestupdate, 109);
but without cutting at a space.
Thanks.
The answer:
The way you do it is pick your midpoint. Looks like you've chosen 109. Then work backwards 1 character at a time, until you hit a space character. So, you'll check the character at 109, 108, 107... until you hit a space. When you do hit the space (say 104), you'll return the substring up to 104. If you have to split the rest of the string, you can start at the length of the returned value + 1.
As far as I know, you'll have to write that function.
-=casey=-
<?php
$x = 109;
$testchar = substr($latestupdate, $x, 1);
while ($testchar!= " ") {
$x = $x - 1;
$testchar = substr($latestupdate, $x, 1);
}
$latestupdate1 = substr($latestupdate, 0, $x);
$latestupdate2 = substr($latestupdate, $x);
?>