0

我们正在做一个项目,我们需要在 PHP DOM 中附加Child 和 ReplaceChild,然后保存文件。

PHP 代码

<?php 
$string = '<u>technical/u>';
?>
<html><head></head>
<body>
<div>Stack Overflow is great website for technical professionals.
<p>checking all of the websites</p>
</div>
<h1>Looking something new for a technical professional</h1>
</body>
</html>

我们只想用重复的词替换 $string ,比如 and 中使用了“technical”。

最终的 HTML 代码将是

<html><head></head>
<body>
<div>Stack Overflow is great website for <u>technical</u> professionals.
<p>checking all of the websites</p>
</div>
<h1>Looking something new for a <u>technical</u> professional</h1>
</body>
</html>
4

0 回答 0