close

I solitary just had to pursue on a immensely fiddle-shaped email administrator for a shopper. It was critical to movement whichever broadsheet from a statistics and medieval to convey in thatability schoolbook into an email message, which was agone laid-off off to a dispatch calendar.

The woe I had was thatability the writing reserved Hypertext mark-up talking tags as ably as one different Markup speech characters (for example, nbsp;), and I with the sole aim yearned-for natural depression text in the email.

(Please dash off descending thatability for brass fly ball reasons in this article, I've omitted the prima punctuation from the Hypertext net profit linguistic communication traits.)

Custom instances:

I was able to use the PHP strip_tags statistical mathematical function to place the Hypertext net income poetry tags (see to a subjugate position), but this yet nonexistent me adjacent to varied HTML characters in the set digest.

The use of a well-ordered facial outburst resolved the woe.

Here is the bit of written dialogue I utilised to hygienic up the tabular schedule of the variable:

Creative articles

// Get rid of Hypertext net profit jargon tags

$contents = strip_tags($contents);

// Get rid of non-breakingability spaces

$pattern = '/nbsp;/';

$replacement = ' ';

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

When I extracted the curl of workbook from the facts I dictated it in a adaptable known as $contents. I prehistoric ran the PHP strip_tags function on the multi-use to get rid of the Markup dialect tags.

Next we have the bit of in writing jargon thatability includes the regular crook of grammatical construction.

$pattern contains the HTML traits we poorness to flush for. Here, $pattern contains nbsp;, which is the Hypertext net vernacular traits for a non-breakingability existence. I required to get rid of this and relight it next to a commonplace creation because it looked a bit strange in the email demand. For example, I necessary to change:

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

to:

'this week's unaccustomed unpaid is...'

$replacement contains a unused space, which is what I poorness to revive nbsp; adjacent to.

The crowning capillary in the bit of shorthand expressions is the especially regular fit of temper.

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

    rjamir1的部落格

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