【发布时间】:2023-01-20 17:30:35
【问题描述】:
使用“SELECT”查询从数据库中获取的字符串,其中包含变量名称“Dear $customer_name”在该页面 $customer_name='John Denie' 但在回显中它打印“Dear $customer_name”而不是“Dear John Denie”
/// in brief codding just to clear idea ///
$customer_name='John Denie';
"SELECT SMS_text From table" //SMS_text value in database is Dear $customer_name
$sms_body=$row["SMS_text"];
echo $sms_body
现在这个 $sms_body echo Dear $customer_name 我希望它应该打印 Dear John Denie 根据代码 $customer_name keep changes here I assigned static value forexample。
我尝试了 {} trim 函数和其他方法,但对我没有任何帮助。有任何想法吗?
【问题讨论】:
-
您是否尝试过使用str_replace?
trim()在这里到底有什么用?