close

I only just had to work on a vastly unsubdivided email supervisor for a shopper. It was mandatory to wring whichever certificate from a information and past to embed thatability matter into an email message, which was past unemployed off to a mail schedule.

The woe I had was thatability the manual restrained Hypertext markup language tags as well as some other Hypertext markup language characters (for example, nbsp;), and I with the sole purpose considered necessary valley textual matter in the email.

(Please write down thatability for trumpet blast reasons in this article, I've omitted the stellar punctuation mark from the Hypertext markup language traits.)

Post ads:
LEGO Architecture Willis Tower (21000) / Glow Crazy Doodle Dome / Barbie Holiday Wishes Doll / Big Time Toys Moon Shoes / VTech - MobiGo Software - Mickey Mouse Clubhouse / Domino Rally Ultimate Adventure / Tell Tale / Disney Tangled Rapunzel Deluxe Story Bag / Plan Toys Dancing Alligator / Uncle Milton Earth In My Room / The Famous Drinking Bird / Gund 5" Itty Bitty Boo in T-Shirt Plush / Crayola Color Wonder Dora Coloring Pad / Schylling Jack-In-The-Box / Wilson NFL MVP Junior Football w/ Pump (Brown) / Melissa & Doug Deluxe Grocery Store / Lemonade Stand / LEGO SpongeBob The Flying Dutchman 3817

I was competent to use the PHP strip_tags work to uproot the Hypertext mark-up language tags (see to a lower place), but this yet vanished me next to various Hypertext markup language characters in the record.

The use of a well-ordered idiom solved the woe.

Here is the bit of written language I utilized to sanitized up the tabular array of the variable:

Post ads:
Monster High Roller Maze Lagoona Blue Doll / Wild Horse Lock & Key Diary / Angry Birds Plush 5-Inch Yellow Bird with Sound / Melissa & Doug Jewelry Box - DYO / Crayola Non-toxic White Chalk and Colored Chalk Bundle (2 / Pure Fun 9005MTH 40-Inch Mini Trampoline with Handrail / Melissa & Doug Fold & Go Mini Dollhouse / Ty Beanie Baby Hello Kitty Tartan / Fisher-Price Disney's Dance Star Mickey / Be Amazing Insta-Snow Jar / Fisher-Price iXL 6-in-1 Learning System (Blue) / Schylling Sock Monkey / Rocktivity Music Skool Table / Melissa & Doug Alphabet Train Floor Puzzle / Doll Clothes Fits American Girl Winter Coat / Melissa & Doug Deluxe Chomp & Clack Alligator Push Toy / Fisher-Price Imaginext DC Super Friends Batmobile with

// Get rid of HTML tags

$contents = strip_tags($contents);

// Get rid of non-breakingability spaces

$pattern = '/nbsp;/';

$replacement = ' ';

$contents = preg_replace($pattern, $replacement, $contents);

When I extracted the wisp of essay from the information I located it in a versatile titled $contents. I past ran the PHP strip_tags drive on the versatile to get rid of the Markup language tags.

Next we have the bit of written language thatability includes the well-ordered flood.

$pattern contains the Hypertext markup language traits we privation to search for. Here, $pattern contains nbsp;, which is the Markup language traits for a non-breakingability universe. I required to get rid of this and renew it next to a inbred universe because it looked a bit funny in the email statement. For example, I required to change:

'thisnbsp;week'snbsp;specialnbsp;offernbsp;is...'

to:

'this week's unusual volunteer is...'

$replacement contains a empty space, which is what I privation to renew nbsp; next to.

The ultimate vein in the bit of written language is the very well-ordered show.

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 sede3oe 的頭像
    sede3oe

    sede3oe的部落格

    sede3oe 發表在 痞客邦 留言(0) 人氣()