草庐IT

FUNCTION_NAME

全部标签

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 到 SMS - 更改 "From Name"

我正在编写一个使用PHP代码通过电子邮件发送电话号码的小型网络应用程序(知道电话号码的人将其视为短信,当然不是电子邮件)。每个电话服务都有电子邮件到文本。例如,美国的Verizon使用@vtext.com。我的问题是,SMS上的FROM总是显示“6245”,这显然是来自Verizon电子邮件域(vtext.com)的SMS标准。我可以用更易读的From而不是这个看似随机的数字来更改代码吗?这是我使用PHP邮件程序的代码:$from=$_POST['email'];$from=filter_var($from,FILTER_SANITIZE_EMAIL);$message.=$guest

php - 使用 ZF2 通过 Doctrine 查询时无法识别的字段 : user_name,

这是我的代码片段,当我尝试这样查询时if($request->isPost()){$form->setData($request->getPost());if($form->isValid()){//checkauthentication...$this->getAuthService()->getAdapter()->setIdentity($request->getPost('username'))->setCredential($request->getPost('password'));$username=$request->getPost('username');$passw

php - 编译失败 : unknown property name after\P

使用PHP5.3.1,PCRE已启用,版本为7.92009-04-11。$string=preg_replace("/\p{Number}/u","",$string);产生错误:编译失败:\P后的未知属性名称。..我知道这是一个在PHP5.3及更高版本中修复的错误,但我显然和其他使用我的脚本的人一样明白了这一点。据我所知,这可能与正在使用的PCRE版本或编译方式有关。我无法控制正在使用的PHP的编译版本。有没有办法检查PHP脚本是否已正确编译PCRE?我也在使用:preg_match("/\p{Lu}/u",$caseChar);preg_match("/\p{Ll}/u",$cas

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 - 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 - 是否可以从扩展中调用 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 array_filter function not found or invalid function name 不管我输入什么

我之前从未使用过array_filter函数,所以无论我使用什么作为函数名称,它都会给我错误,请尝试一下Warning:array_filter()expectsparameter2tobeavalidcallback,function'odd'notfoundorinvalidfunctionnamein我什至采取了直接从php手册页复制粘贴示例的步骤,它给了我同样的错误。代码:functionodd($var){//returnswhethertheinputintegerisoddreturn($var&1);}functioncalculate($res,$period,$el