News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

quick eregi_replace to preg_replace question

Started by Kindred, November 27, 2017, 11:35:38 AM

Previous topic - Next topic

Kindred

since eregi _replace is deprecated, I need to convert to preg_replace.... but I'm not sure I fully understand the original code

So, help is requested form someone who groks php on a more than "hack it up" level...

How would I convert this (below) to a preg_replace?


eregi_replace('([[:punct:]])', '', $_POST['user'])

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Suki

Try the following:


preg_replace('/([[:punct:]])/i', '', $_POST['user'])


hahah the wiki thing doesn't let me post the punct regex
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Advertisement: