Jump to content

[SOLVED] Removing ASCII code from query


jaxdevil

Recommended Posts

I have a code that is stripping all HTML markup away from a database field before outputting it, but there are still ASCII character markups left like:

 

™

 

I tried using preg_replace but I must be doing it wrong because it is not removing anything. Here is the code, can you tell me what I am doing wrong?

 

	$description = $row['description'];
$details = $row['details'];
$description = strip_tags($description);
$details = strip_tags($details);
$pattern = '&#*;';
$replacement = '';
$description = preg_replace($pattern, $replacement, $description);
$details = preg_replace($pattern, $replacement, $details);

Link to comment
https://forums.phpfreaks.com/topic/107273-solved-removing-ascii-code-from-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.