我想写一个回声来回显一个变量和一个rtrim函数,但我似乎无法得到正确的语法。任何人都可以帮助如何正确书写这一行吗?php mysql echo变量
if ($str == ""){echo "$tech_name";}
else echo "$tech_name" rtrim($str,",");
我想写一个回声来回显一个变量和一个rtrim函数,但我似乎无法得到正确的语法。任何人都可以帮助如何正确书写这一行吗?php mysql echo变量
if ($str == ""){echo "$tech_name";}
else echo "$tech_name" rtrim($str,",");
连接rtrim?
else {
echo "$tech_name" . rtrim($str,",");
}
else {echo $ tech_name。rtrim($ str,“,”);} –
是的,花括号总是一个很好的附加条件 - 即使是其他部分 - 我会更新答案。 –
您还可以创建一个班轮:'回声(空($ STR)$ tech_name:?$ tech_name.rtrim($海峡, '');'或'$回声tech_name(空( $ str)?'':rtrim($ str,','));'。您不需要引号中的'$ tech_name' – ctwheels