html php function translateHtml content content substr content 500 con

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
<html>
<?php
function translateHtml($content)
{
$content = substr($content,0,500);
$content = htmlspecialchars($content);
$content = nl2br($content);
$content = ereg_replace("\n","",$content);
$content = ereg_replace("#^","",$content);
$content = str_replace('^',' ',$content);
$content = ereg_replace("\(","&#040;",$content);
$content = ereg_replace("\)","&#041;",$content);
$content = ereg_replace("\\$","&#036;",$content);
$content = stripslashes($content);
return $content;
}
?>