I have this string (98)
1994 Acura Integra Type R OEM B18C5 OEM Tranny All Stock Interior. 165,000 MI $9500 (000) 000-1696
I need to break it at string position 57.
My intention is find the first occurrence of a space character (regex \s) going backward from pos 57.
Then break the string there, so the string would split like this:
1994 Acura Integra Type R OEM B18C5 OEM Tranny All Stock // str1
Interior. 165,000 MI $9500 (000) 000-1696 // str2
I have tried multiple ways and can't seem to solve it:
$charAt58 = substr($content, 57, 1);
$hasWhiteSpaceAt58 = preg_match('/\s/', $charAt58);
if (!$hasWhiteSpaceAt58) {
echo "false";
$contentr = strrev($content);
echo "<br>";
echo strpos($contentr, " ", 57);
}
Any help would be extremely appreciated.
strrpos($string, ' ', 57);I need the string split at the proper location which would be at the whitespace prior to str pos 57.If that is the exact description then yes it would be. Regardless of how long the string is.