getButterfly Logo getButterfly code wrangling since 2005

This function emulates WordPress wpautop() function for custom PHP scripts, parses URL addresses and adds smilies/emoticons.

  • First of all, the function changes 2 line breaks (HTML <br>) into a paragraph.
  • Second, the function changes the remaining single line breaks into HTML <br>, making a SHIFT+ENTER new line.
  • Third, the function parses text URLs and adds hyperlinks and detects preset smilies/emoticons from a function array.

Subscribe to getButterfly Blog

Once a week or so we send an email with our best content. We never bug you, we just send you our latest piece of content.

If you found any value in this post, agree, disagree, or have anything to add - please do. I use comments as my #1 signal for what to write about. Read our comment policy before commenting! Comments such as "Thank you!", "Awesome!", "You're the man!" are either marked as spam or stripped from URL.

Leave a reply