使用 php 检查文本区域
我有一个 textarea 字段,想要在该字段为空时添加文本或 php 代码,如果该字段不为空则添加另一个 php 代码。例如:
如果该字段为空>做某事.....否则>做某事...
我不擅长php,所以我会很高兴获得任何帮助。 谢谢。
ps抱歉我的英语。
I have a textarea field and want to add a text or php code when the field is empty and if the field is not empty to add another php code. For example:
if the field is empty>do something.....else>do something...
I'm not good at php, so I'll be glad for any help.
Thanks.
p.s.Sorry for my english.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
假设您通过表单发布此内容,那么您可以执行以下操作。
我会写得很长,这样更容易理解:
Assuming you're posting this from a form then you can do the following.
I'll write this out the long way so it's easier to understand:
要测试外部变量是否为空,您可以将其与空字符串进行比较
To test if outside variable is empty or not, you can just compare it with empty string