php ile otomatik olarak açık html etiketleri kapatmak için nasıl?

0 Cevap php

I developed many sites on php and mysql.
I have a problem on fetching certain words like i use

SELECT *,left('<field>',200) from < table >

I got the problem on layout of whole website due to no closing of opened tags.
any suggestion would be great.

I used strip_tags() and then substr() to crop text.
but i need a permanent solution.

update

<?php
$fragment = '<p>What a mighty fine <a href="blah">da';
$tidy = new tidy();
$tidy->parseString($fragment,array('show-body-only'=>true),'utf8');
$tidy->cleanRepair();
echo $tidy;
?>

php.ini ile localhost php_tidy extension etkinleştirmek çalışır.

0 Cevap