","\n%title%",$data); $data = str_replace("
","%",$data); //$data = str_replace("
","\n%content%",$data); $data = str_replace("
","\n%person%",$data); $data = str_replace("
","%\n%comment%",preg_replace("/text_expose_id_[a-zA-Z0-9_]+/","",$data)); $data = str_replace("
","%",$data); $data = strip_tags($data); $max = strlen($data); $count = 0; print_r(nl2br($data)); //this loop finds the tags and sends them to the appropriate parser. while ($count < $max) { if ($data[$count] == '%') { //Get the %tag% $count++; while($data[$count] != "%" && $count < $max) { if ($data[$count] == '\n') break; $tag = sprintf("%s%s",$tag,$data[$count]); $count++; } $count++; if($tag == "title") { $title = NULL; //new Blog while ($data[$count] != '%' && $count < $max) { $title = sprintf("%s%s",$title,$data[$count]); $count++; } echo "Article: " . $title . "
\n"; } if($tag == "person") { $person = NULL; while ($data[$count] != '%' && $count < $max) { $person = sprintf("%s%s",$person,$data[$count]); $count++; } echo "Author: " . $person . "
\n"; } if($tag == "comment") { $comment = NULL; while ($data[$count] != '%' && $count < $max) { $comment = sprintf("%s%s",$comment,$data[$count]); $count++; } echo "Comment: " . $comment . "

\n\n"; } $tag = NULL; } $count++; } */ } //This next function I got of the PHP manual comments apparantly this is from Squirrel Mail, Love that project! function charset_decode_utf_8 ($string) { /* Only do the slow convert if there are 8-bit characters */ /* avoid using 0xA0 (\240) in ereg ranges. RH73 does not like that */ if (! ereg("[\200-\237]", $string) and ! ereg("[\241-\377]", $string)) return $string; // decode three byte unicode characters $string = preg_replace("/([\340-\357])([\200-\277])([\200-\277])/e", "'&#'.((ord('\\1')-224)*4096 + (ord('\\2')-128)*64 + (ord('\\3')-128)).';'", $string); // decode two byte unicode characters $string = preg_replace("/([\300-\337])([\200-\277])/e", "'&#'.((ord('\\1')-192)*64+(ord('\\2')-128)).';'", $string); return $string; }