gpt4 book ai didi

php - 将类添加到字符串中的每个 A 标签

转载 作者:太空宇宙 更新时间:2023-11-04 04:09:55 24 4
gpt4 key购买 nike

刚开始将网站转换为 wordpress 时遇到问题。我将默认输出 Table 剥离到 A 标签,但遗憾的是 wordpress 没有将任何样式信息放在 A 标签(class 或 id)上

$menuArgs = array(
//...Args...
);
echo strip_tags(
wp_nav_menu( $menuParameters ), '<a>' );?>

有什么方法可以轻松地将 class="MenuLink" 添加到每个 Echoed A 标签??还是我必须使用一些 substr_replace 之类的函数 ~

最佳答案

关于php - 将类添加到字符串中的每个 A 标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20829738/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com