Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

striping characters from strings 1

Status
Not open for further replies.

mrmtek

Programmer
Oct 13, 2002
109
AU
is there away of stripping unwanted characters from strings and replacing them with other characters.
for example is a string contains a ' I want to replace it with a space, is this possible.
 
Here is an example of removing a leading 0.

$num = 0.4567;

$result=preg_replace("/^0*/","",$num);

echo "$result";

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top