I have a cms that on the front-end grabs pages by id, as shown here:
$pageid = ereg_replace("[^0-9]", "", $_GET['pid']);
This is some old code I am trying to update since POSIX is deprecated, however my efforts to convert (using preg_replace) have been unsuccessful. If anyone could convert that line for me, I would greatly appreciate it.
Add code from comments
My first guess was something along the lines of
$pageid = preg_replace("/[^0-9]/","",$_GET['pid'];
Which gave errors, so I further reduced it to
$pageid = preg_replace("/^0-9/","",$_GET['pid']
Forgive me, my understanding of regex is rather limited.