I can't seem to figure this out... and I admit I'm not up to date with the new stuff. I was using eregi_replace
, but switched it to preg_replace
and added the delimiter. Now it is not working correctly.
I have fields that are in a form, that are sent to a form validator, and the error message lets the user know which fields are missing; i.e. "firstname, lastname, password, etc.". The error needs to show as "First Name or Last Name", basically adding a space and capitalizing the N in Name.
Can someone point out what I'm doing wrong?
This is what used to work:
$r .= ucwords(eregi_replace("_", " ", $c));
This is what I changed it to:
$r .= ucwords(preg_replace("/_/", " ", $c));
Now they just show as Firstname
, Lastname
but I would like them to show as First Name
, Last Name
.