How do I add spaces to input in the data?
Example:
$request->PoliceNo= B123A
Must be in database = B 123 A
How do I add spaces to input in the data?
Example:
$request->PoliceNo= B123A
Must be in database = B 123 A
You can use preg_replace. stated at Regex: Add space if letter is adjacent to a number
$test= 'B123A';
$request->PoliceNo= preg_replace('/(?<=[a-z])(?=\d)|(?<=\d)(?=[a-z])/i', ' ', $test);