I have word like following:
$string1 = ucwords("bookingID");
substr(preg_replace("/([A-Z])/", ',\\1', $string1), 1))
output is coming like : Booking I D
but I want to avoid space insertion if two consecutive capitals are there.
Expected output: booking ID
If I enter word like bookingAmountReceived then expected output is: Booking Amount Received
1 Answer