Im trying to strip all bullshit out of user post input before i put it into the database ... i want to strip anything but letters , numbers , underscores , and spaces
the code ive come up with is using preg_replace , is this the best way?
preg_replace("/[A-Za-z0-9 ]/", "", $text);
that will not allow underscores , how could i make an addition to this to allow underscores? and is preg_replace the best way to do this?
thank you.