remove tags,special character and inverted comma from content

Posted: June 30, 2015 in Uncategorized
Tags: ,

Use strip_tags function Remove HTML tags

$result_temp_cont= strip_tags($r[‘post_content’]);

Use preg_replace function to remove special cahracter

$result_temp2_cont= preg_replace(“/&#?[a-z0-9]+;/i”,””,$result_temp_cont);
another code
$Content = preg_replace(“/&#?[a-z0-9]{2,8};/i”,””,$result_temp2_cont);

Use preg_replace function to remove inverted comma or delimeter

$result[$counter][‘post_content’] = preg_replace(‘”‘,”,$result_temp2_cont);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s