taith Posted December 19, 2006 Share Posted December 19, 2006 trying to remove all ,'s from a string, but i get a nice error...[code]$i= preg_replace(",", '', $i);[/code]Warning: preg_replace() [function.preg-replace]: No ending delimiter ',' found in /home/.sites/16/site168/web/taith/md5.php on line 3 Quote Link to comment Share on other sites More sharing options...
Orio Posted December 19, 2006 Share Posted December 19, 2006 The preg functions require the expression to be wrapped by two slashes.[code]$i= preg_replace("/,/", '', $i);[/code]Orio. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted December 19, 2006 Share Posted December 19, 2006 Use str_replace() instead:[code]<?php$i = str_replace(',','',$i);?>[/code]Ken Quote Link to comment Share on other sites More sharing options...
taith Posted December 19, 2006 Author Share Posted December 19, 2006 thats it! str_replace... lol... knew i was doin somin wrong ;-) thanks :-P Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.