A uncertain called contents i | nmvfnestorのブログ

nmvfnestorのブログ

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

I latterly had to cultivate a greatly bare email director for a client. It was important to passage whatever manuscript from a information and then to embed that paper into an email message, which was next pink-slipped off to a post account.

The inhibition I had was that the matter restrained HTML tags as good as remaining HTML characters (for example, nbsp;), and I lone yearned-for down-to-earth record in the email.

(Please record that for retrospective reasons in this article, I've omitted the major punctuation from the HTML character.)

Latest sources:
A Chinese Beggars' Den: Poverty and Mobility in an Underclass
Art and nature at home and abroad, Volume 1 (Google eBoek)
An account of travels into the interior of Southern Africa in the
Enterprise Security Architecture Using IBM Tivoli Security Solutions
Frommer's Ireland 2011
Regularity in Semantic Change
Wood-Fired Ceramics: Contemporary Practices
Sippy Cups Are Not for Chardonnay: And Other Things I Had to Learn
Ordeal by Innocence One, Two, Buckle My Shoe The Adventure of the
English In The Middle Ages

I was competent to use the PHP strip_tags control to expunge the HTML tags (see to a lower place), but this stagnant port me next to several HTML characters in the schoolbook.

The use of a timed facial expression resolved the job.

Here is the bit of attitude I utilized to sterile up the table of contents of the variable:

Number of records
Homeland: An Archaeologist View of Yellowstone Country's Past
The Everything Large-Print Crossword Challenge Book: Easy to Read,
Moshkel Gosha: A Story Of Transformation
Cartoonist profiles, Volumes 85-88
A Compass Error: A Novel
The Rand McNally world atlas of exploration
Chesapeake Bay Activity Book
How to Open Doors with a Brillian Elevator Speech
Anne Bonny and Mary Read: Fearsome Female Pirates of the Eighteenth

// 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 part of file from the database I located it in a uncertain called $contents. I consequently ran the PHP strip_tags drive on the unstable to get rid of the HTML tags.

Next we have the bit of attitude that includes the well-ordered face.

$pattern contains the HTML guise we want to flush for. Here, $pattern contains nbsp;, which is the HTML part for a non-breaking extent. I needed to get rid of this and replace it beside a typical extent because it looked a bit abnormal in the email phone call. For example, I required to change:

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

to:

'this week's outstanding present is...'

$replacement contains a white space, which is what I impoverishment to replace nbsp; near.

The second queue in the bit of symbols is the actual day-to-day turn of phrase.