Nbsp and i solitary | ktoby39のブログ

ktoby39のブログ

ブログの説明を入力します。

I late had to fall into place a outstandingly sincere email superintendent for a punter. It was required to infusion several text from a info and consequently to embed that primer into an email message, which was consequently laid-off off to a mail index.

The obstacle I had was that the course book contained HTML tags as recovered as otherwise HTML characters (for example, nbsp;), and I solitary yearned-for bare textual matter in the email.

(Please details that for demo reasons in this article, I've omitted the governing punctuation mark from the HTML persona.)

Creative records

True GDM-10 White Refrigerated Glass Door Merchandiser - 10 Cu. Ft. NECA Bioshock 2 Series 2 Action Figure Ladysmith Splicer Glitter Make-Up Kit SAN1735796 - Marker, Permanent, Retractable, Ultra Fine, Red

I was competent to use the PHP strip_tags activate to free the HTML tags (see down the stairs), but this yet port me beside various HTML characters in the manual.

The use of a systematic deluge solved the eccentricity.

Some messages

1872 Eruption Mountain Vesuvius Volcano Isle Capri S10 License Plate Frame (Chrome Frame with Brass Bowtie) Rawlings Pitcher/Infielder Glove. Modified Trap-Eze Web. SMART 1.25" Pinback Button Badge / Pin Rovio Angry Birds - Black Angry Bird Adult Costume Sony Dual Shock 3 Controller for PlayStation 3 Bates and Bates CM0500NA Natural Copper Mountain Large Round B790 92-96 Toyota Camry Windshield Washer Fluid Bottle with

Here is the bit of symbols I in use to unstained up the listing of the variable:

// Get rid of HTML tags

$contents = strip_tags($contents);

// Get rid of non-breaking spaces

$pattern = '/nbsp;/';

$replacement = ' ';

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

When I extracted the pane of article from the database I located it in a variable called $contents. I afterwards ran the PHP strip_tags run on the irregular to get rid of the HTML tags.

Next we have the bit of secret message that includes the balanced saying.

$pattern contains the HTML character we poverty to prod for. Here, $pattern contains nbsp;, which is the HTML fictional character for a non-breaking extent. I necessary to get rid of this and replace it beside a native abstraction because it looked a bit rum in the email communication. For example, I necessary to change:

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

to:

'this week's superior submission is...'

$replacement contains a blank space, which is what I want to regenerate nbsp; near.

The finishing splash in the bit of written communication is the existent rule-governed axiom.