I want to use php str_replace() function on some condition.
Eg : if the string has am i want to replace with :00 and if it has pm i want to replace with :00. There will be one am or pm on the string and I want to replace with same variable. How do I do it using PHP?
$classRoom->start =Carbon::parse($request->input('start'));
dd(str_replace(array('am', ':00'), array('pm', ':00'),$request->input('start')));