Cleaning form submited strings
I need a method for cleaning strings from all NON alphabetic and numeric characters that are submitted by a form
I have the following strings:
$data1 - $data2 and $data3
before writing these 3 strings to file, I want to eleminate all characters that are not a-z, A-Z and 0 to 9 and replace them with nothing, not even a blank.
Meaning if $data1 = "my tel # 025/123.895.548"
should become $data1 = "my tel 025123895548"
Then I need the same as above but also eleminating blank spaces
$data5 = "map &125 #abc <small"
$data5 = "map25abcsmall"
And to make things even worse I need a very difficult one
That eleminates everything that is not a number or a decimal point.
$data6 = "Temperature for city $manoi <b>40.08</b> celcius"
$data6 = "40.08"