add readbook

This commit is contained in:
Andrey Kuvshinov
2020-05-24 17:10:45 +03:00
parent 02b7d3f8fa
commit d91466c5d9
4 changed files with 37 additions and 17 deletions

View File

@@ -40,6 +40,7 @@ function endparagraf($html, $pos){
function convert2html($xfile){
if (!file_exists($xfile)){
echo 'file not found';
return '';
}
@@ -48,8 +49,10 @@ function convert2html($xfile){
$result = str_replace('</body>', '', $xhtml);
$result = str_replace('</html>', '', $xhtml);
//$start_style =(strpos('<style>', $result))
if ($pos = strpos('<body', $result)){
$result = substr($result, $pos+1);
$result = substr($result, $pos-1);
}
return $result;