Jump to content

sql query to strip all non a-z/0-1 characters?


acctman

Recommended Posts

It would not be done in SQL, it would be done before  the value is entered into SQL or upon retrieving the value from SQL.

 

<?php
$string = "stripallalpha%$%2324numerics";
$string = preg_replace("~([a-z0-9])~i", "", $string);
echo $string;
die();
?>

 

Should leave you with %$%.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.