문제

I am trying to use substr function in PHP for the below html string

<HR><CENTER><B>References <a href="aaaa">[Referenced By]</A></B></CENTER>       <HR>
         <CENTER><b>Documents</b></CENTER>
<TABLE WIDTH="100%"> <TR><TH scope="col" WIDTH="33%"></TH> <TH scope="col" WIDTH="33%"></TH> <TH scope="col" WIDTH="34%"></TH></TR> <TR> <TD ALIGN="left">

$html is the variable that includes the string above, and my code as below

$ints = strpos($html,"<b>Documents</b></CENTER>");
$ii=strlen("<b>Documents</b></CENTER>");

echo substr($html,$ints + $ii+2,7);

this is working very well with me and I got result

TABLE W 

but when I tried to write the echo as below I have a blank page with no errors

echo substr($html,$ints + $ii,7);

any suggestion what is wrong? is the starting of the new line is the reason? appreciate your help and if you have any solution.

도움이 되었습니까?

해결책

You're not getting a blank page. You're probably getting a rendered HTML page that happens to contain <TABLE. Do a 'view source' to confirm.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top