I found this gem today.

$special = str_replace(“,,,,”,”,”,$special);
$special = str_replace(“,,,”,”,”,$special);
$special = str_replace(“,,”,”,”,$special);

Pretty sweet.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Reddit
 

2 Responses to Found Code: Replacing Runs of Commas

  1. JDS says:

    Three replaces? try

    $special = preg_replace(“/,,*/”,”,”,$special);

  2. jon says:

    I think you missed the point of my post. I was posting a block of ridiculous code that I found while working on a web site.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>