Jump to content
MakeWebGames

Recommended Posts

Posted

So basically you want that the display displays something different that the database contains? Yes you can, if you have some very well defined rules.

For example we could replace all the A with a B:

echo str_replace("A","B","AAAAAAA");

You may also try regular expressions in case.

Posted

a nice filter solution could be something like so

// Basically this filters the Variable.
// ctype_alnum Simply checks if the variable doesn't contain alpha/numeric chars
// ereg_replace simply you replace _ with nothing in the $var
// ^this is so it will not recognize the _ to be a issue and then allows _, Alpha and Numeric.
  $var = (!ctype_alnum(ereg_replace('[_]', '', $var)) ? $var : '' ;
 echo $var;

 

Hope this helps

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...