I want to replace space with "|"
and i want only numbers and alphabets and star(*) in the sting
And i have tried str_replace()
funtion but it replace the space with | , but i want to validate
echo $text= str_replace(' ','|', "This is some $123 Money");
output
This|is|some|$123|Money
what i expect is
This|is|some|123|Money
I don't want any other special characters in my output
Any Suggestions
Thanks in Advance