草庐IT

Function-Index

全部标签

PHP 调用 function_exists 中的函数

如果我使用function_exists如下:if(!function_exists('get_value')):functionget_value($field){..return$value;}endif;现在,当我在上述函数之前调用同一个文件中的函数时,它会给出fatalerror:Fatalerror:Calltoundefinedfunctionget_value()...但是,如果我在上述函数之后调用它,它将返回值而不会出现任何错误。现在,如果我删除function_exists条件,即:functionget_value($field){..return$value;}如

php - 意外的 T_FUNCTION,但是在哪里?

我已经让我的网站在我的本地机器上完美运行。但是,迁移到生产环境时,我遇到了“意外的T_FUNCTION...”错误。我已经删除了以下代码之前的所有内容,但仍然收到第3行的错误报告。我就是想不通。 最佳答案 你得到:Parseerror:syntaxerror,unexpectedT_FUNCTIONin[...][...]online4因为您使用的PHP版本低于PHP5.3.0升级您的php或尝试使用globalsPHP5.3.0+$app="HelloWolrd";$authCheck=function()use($app){ec

php - 如何解决 Windows 中的 "Call to undefined function dbase_open() "错误

您好,我想将DBF文件加载到mysql,我正在使用xampp,php版本5.5.6我写了下面的代码,但是我得到错误---Fatalerror:Calltoundefinedfunctiondbase_open()inC:\xampp\htdocs\imports\import_geo.phponline47$dbf=dbase_open('OUTLETS/regions.dbf',0);$num_records=dbase_numrecords($dbf);for($i=1;$iexecute(array(':id'=>$next_brick_id,':type'=>'Region',

php - fatal error : Call to a member function getAttributes() on array

我一直在做这个google身份验证教程,以更好地了解如何使用googlesigninapi,但我最近收到了这个错误:Fatalerror:CalltoamemberfunctiongetAttributes()onarray.每当我尝试:$this->client->verifyIdToken()->getAttributes();在getPayload()函数中。我不知道为什么会这样。我的配置是Windows10,我正在使用WAMP服务器来运行这个应用程序。任何帮助将不胜感激。client=$googleClient;$this->client->setClientId('234sf

php - Laravel 5.1 在运行 'undefined index: http_host ' 时给出 'php artisan serve'

我用5.4版学习了laravel6个月。然后我安装了最新的xampp。但现在我开始从事一个基于laravel5.1的项目。但是当我想运行应用程序时,它给了我错误(undefinedindex:http_host)!我怎样才能找到错误的来源?我该如何解决这个问题?我在网上搜索但没有找到任何成果。你能帮我吗?存储/log.php:[2017-07-1821:55:50]local.ERROR:ErrorException:Undefinedindex:HTTP_HOSTinH:\Current\school\school\app\Providers\AppServiceProvider.p

php - SimpleHTMLDom : Call to a member function find() on array

所以我想在大型html页面中循环遍历特定的TD。我正在使用simplehtmldom来实现这一目标。问题是如果不把每一步都放在foreach中,我就无法让它工作。这是我的phpinclude('../inc/simple_html_dom.php');$html=file_get_html("http://www.bjork-family.com/f43-london-stories");//IjustputthedomofpagebodyintoTEST$test=$html->find('#page-body');foreach($test->find('img')as$eleme

php - 新的 Laravel 安装 v 5.4 index.php 抛出解析错误。 PHP 7.2.10-0ubuntu0.18.04.1

这个问题在这里已经有了答案:PHPparse/syntaxerrors;andhowtosolvethem(20个答案)关闭4年前。在DigitalOcean、Ubuntu上安装新的Laravel。当前PhP安装。Apache2可以正常访问Php,因为我添加了几行代码来吐出错误。这是输出:解析错误:语法错误,/var/www/html/blog/vendor/laravel/framework/src/Illuminate/Support/Arr.php第388行出现意外的'='publicstaticfunctionpluck($array,$value,$key=null){$re

php - 是否可以从扩展中调用 PHP_FUNCTION

让我详细说明标题。考虑例如PHP_FUNCTION(session_start)。我能否从另一个PHP_FUNCTION的session_id中调用session_start(这只是为了说明而不是实际目的)? 最佳答案 嗯,是的,但你应该尽可能避免它。编写函数的内部实现的主要好处之一是,与PHP中发生的情况相反,C函数调用很便宜。此外,在C代码内部调用PHP函数相对痛苦。例如,在session_start的情况下,您有php_session_start,它由session扩展公开。由于我在第一段中的描述,扩展通常会导出可能对其他人有

arrays - "Can' t use function return value in write context”PHP错误

Fatalerror:Can'tusefunctionreturnvalueinwritecontextinline3,在什么情况下会触发此类错误?我的程序://QUERYVARIABLE$query="select*formuserwhereuser_name='$user_name'anduser_password='sha($user_password)'";//ESTABLISHINGCONNECTION$result=mysqli_query($dbc,$query)ordie('ErrorQueryingDatabase');while($row=mysqli_num_ro

php - 绕过 index.php 文件

我有点小问题。我目前正在为正在运行的网站添加一个网站。现在当前的网站是用一个我无法识别的随机框架编写的,并且由于添加的内容相当广泛,我正在使用CodeIgniter从头开始​​。现在我将我的文件添加到服务器中,前导文件名为“business.php”。调用我的页面与“www.mysite.com/business.php”配合使用效果很好,但是当我尝试使用“www.site.co/business.php/myController”之类的CI调用来调用Controller时,出现错误服务器默认首先调用index.php文件,并且有另一种处理URI的方法。谁能告诉我如何绕过原始文件?tn