Webpage a
<iframe src="">https://b. The hyperlink in com/"></iframe>
b.com has the "target="_blank" attribute. Clicking the hyperlink directly opens a new window. How to make it After clicking the hyperlink, it is still displayed within the iframe?
I tried
<?php
$url="https://b.com"
$html= file_get_contents($url);
$str = str_replace("_blank","_self",$html);
echo '<iframe srcdoc=" '.$str.'"></iframe>'
?>
The iframe output like this is a whiteboard, echo $str directly, see I can't use it directly. Is there any way to solve this problem? I have searched in many places but can't find a solution. By the way, b.com is not mine, so I can't change the name