Hi there! I have a function that is retrieving whatever string exists between two tags in an html document. But if there are any quotation marks ' or " in the string, when it retrieves the info and displays it to my form, it puts an escape character \ just before the quotation mark. Does anyone know how I can get rid of these escape characters? Here's my function:
(where datatype may be a tag like <image> </image>)
function display_field($datatype,$in_page){
if(!$in_page){
return "";
}
else{
$directory="some directory";
$page = $directory.$in_page;
$pagefile = fopen($page, "r");
$data = fread($pagefile, filesize($page));
if (eregi("<" . $datatype . ">(.*)</" . $datatype . ">", $data, $out)) {
$outdata = $out[1];
}
return $outdata;
}
}
?>