Is it possible to replace an upper-case with lower-case using preg_replace and regex?
For example:
The following string:
$x="HELLO LADIES!";
I want to convert it to:
hello ladies!
using preg_replace():
echo preg_replace("/([A-Z]+)/","$1",$x);
preg_replacealone as there is no pattern. Why not usingstrtolower?strtolower()to simple a solution?$x="HELLO LADIES!"; $x=strtolower($x);;-) as a quick one-liner if you don't need the preg_ function.