Want more features on Pastebin? Sign Up, it's FREE!
Guest

Quotation mark conversion: vertical to curly

By: a guest on Jun 5th, 2011  |  syntax: PHP  |  size: 0.22 KB  |  views: 225  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. function doitwell($text)
  3. {
  4. $original=array(' "', '" ');
  5. $replaced=array(' “', '” ');
  6. return str_replace($original,$replaced,$text);
  7. }
  8.  
  9. $tryitnow = doitwell('We "see" if "it" works or not');
  10. echo $tryitnow;
  11. ?>
clone this paste RAW Paste Data