我有一个名为$ info ['order-total']的变量,其中包含一些html,其中HTML是字符串'Delivery'和'Collection'。我试图用字符串'Card Charge'替换它们。这是我试图用它实现的代码。我希望有人能在这里帮助我,我是初学者,谢谢:)。
<?php
$total = str_replace("Delivery", "Card Charge", $info['order_total']);
$total = str_replace("Collection", "Card Charge", $info['order_total']);
print $total;
?>
答案 0 :(得分:0)
试试这个:
<?php
$total = str_replace("Delivery", "Card Charge", $info['order_total']);
$total = str_replace("Collection", "Card Charge", $total);
print $total;
?>