How to remove 2 last characters with preg_replace : I have a code like : 784XX . XX could be a character or number. and i need a expression to remove the last 2 characters (XX) using ( and only ) **preg_replace**.

How can i do that?


For example, the output of :

782A3 is 782,

12122 is 121,

6542A is 654,

333CD is 333,