我想检查一个变量是否包含*或**,然后我希望它根据找到的内容显示div。我写了一个不起作用的脚本。如果变量包含文本,则显示div
我现在已经改变了它使用PHP和它现在的工作:
<?php
if (strpos($this->element->product_description, '*') !== false) {
echo '<div class="asterisk">
<ul class="asterix">
<li>* Subject to receipt of payment and print ready artwork or sign off of proofs. Large quantities may require a longer lead time.</li>
<li>** Custom sizes can be manufactured to order, longer lead times may apply.</li>
</ul>
</div>';
};
?>
你在哪里你是例如定义呢?也 –