我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Php:从函数返回一个字符串[关闭]

The simple program is not returning the string,Please help.

<?php 
function returnStr() {
return "fooBar";
}
$str=returnStr();
echo $str;
}
?> 

There's a fatal error tokenizing the code due the trailing/unmatched '}' remove that and the code will work. Then spend some time thinking about why you didn't know this already

It's a parse error:

$str=returnStr();
echo $str;
}                   // WHAT IS THIS BRACKET DOING HERE?

There's an error in your code. The last } is useless.

近期文章

  • php错误无法重新声明类
  • php在foreach循环中使用预处理语句
  • Php在链接中获取图像名称
  • 如何找到一个项目呢? [关闭]
  • 如何访问根目录之外的文件并使用它们
  • 在SOAP中访问多个响应
  • 找不到php文件的文件
  • 首先插入然后更新表中的经度和纬度
  • PHP图像缩放 - 指数刻度
  • 无法在多个表的PHP页面上显示数据
  • Php上传覆盆子pi上的脚本
  • PHP SoapClient可以抛出自定义SoapFaults
  • 这可以提高效率吗?
  • 数据触发器与fancybox冲突
  • MailSo echo文件夹内容
  • 为什么输出后的数组不对??
  • VUE URL参数中包含多个斜杠怎么处理
  • cocos-lua 中使用 registerScriptTouchHandler 开启的多点触摸为什么一直无法获取到 第二个触摸点?
  • 在ros上实时运行视觉slam,保存地图问题
  • 如何控制各个医院各个职位的数据查看权限,表设计如何设计,提供下思路

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华