我想保存 DOM 标签值以存在 XML,我找到了替换函数,但它在 js 中,我需要 PHP 中的函数
我试过save并saveXML运行,但这没有用。我在 XML 中有带有冒号“iaiext:auction_title”的标签。我使用过getElement并且效果很好,接下来我将标题缩短为 50 个字符的功能也有效,但是如果我不使用像 simple_load_file 这样的路径,我如何将旧标题替换为这个新标题。如何在我的脚本中显示此路径?
$dom = new DOMDocument;
$dom->load('p.xml');
$i = 0;
$tytuly = $dom->getElementsByTagName('auction_title');
foreach ($tytuly as $tytul){
$title = $tytul->nodeValue;
$end_title = doTitleCut($title);
//echo "<pre>";
//echo($end_title);
//echo "<pre>";
$i = $i+1;
}