草庐IT

override_function

全部标签

IIS 上的 PHP 7 : Call_user_function could not be located

我正在尝试在Windows2012R264位服务器上将MicrosoftSQLServer驱动程序与PHP7.1非线程安全x64一起使用。无论我做什么,当我从管理员命令提示符运行php时,我都会收到错误Warning:PHPStartup:Unabletoloaddynamiclibrary'ext\php_pdo_sqlsrv_7_nts.dll'-Thespecifiedprocedurecouldnotbefound.此外,它还会弹出一个窗口,说明Theprocedureentrypointcall_user_functioncouldnotbelocatedinthedynam

php - 警告 : mkdir() [function. mkdir] : No such file or directory PHP?

尝试在PHP中使用mkdir()函数时出现此错误。基本上,我是在我的服务器上创建一个基于inputfield的HTML表单中名为(inPut)的sundomain。现在我正在尝试在该子域创建目录后创建它。所以我使用下面的代码:$subDomain=$_POST['inPut'];mkdir("$subDomain.mydoamin.com/newDirectory",0755);但我收到以下错误:Warning:mkdir()[function.mkdir]:Nosuchfileordirectoryinline99.第99行是这样的:mkdir("$subDomain.mydoami

php - fatal error : Uncaught ArgumentCountError: Too few arguments to function

我知道有一些与此相关的问题,但有C++或其他语言的问题。我得到这个错误,我不确定我的功能有什么问题。我的错误是这样的:Fatalerror:UncaughtArgumentCountError:ToofewargumentstofunctionUser::register(),2passedinC:\xampp\htdocs\register.phponline39andexactly5expectedinC:\xampp\htdocs\classes\users.php:22Stacktrace:#0C:\xampp\htdocs\register.php(39):User->reg

php - 将 Wordpress functions.php 中的代码仅应用于一个类别

有没有办法限制我添加到我的functions.php文件中的以下代码,使其仅适用于单个wordpress类别?我试过了,但似乎没有用:我还应该补充一点,我通过将代码直接放在特定类别模板中解决了这个问题,但我更愿意将过滤器保留在我的函数文件中。谢谢! 最佳答案 我相信你会想Hook到pre_get_postsaction.它在解析查询字符串后立即触发。设置了一些但不是所有的条件。您可以测试in_category()是否是其中之一,但我认为这不重要。为什么?很高兴你问。钩子(Hook)将向您传递查询对象,该对象具有属性category_

register_tick_function() 调用的 PHP debug_backtrace() 不返回完整堆栈

我想使用register_tick_function()Hook以下调用并使用debug_backtrace()打印它们的堆栈跟踪。如果我运行下面的代码。它只打印dump()函数。Functiondump()hasbeencalledFunctiondump()hasbeencalledFunctiondump()hasbeencalled为什么我没有看到print()和array_search()跟踪数据?这就像在调用dump()之前堆栈已被重置。我也很确定它在过去工作正常。 最佳答案 你误解了什么是回溯,这个堆栈不是PHP在到达

php - Laravel 验证 : Call to a member function fails() on null

这段代码几天前还可以工作,但我似乎做了一些事情导致它崩溃了。我有这条路线:Route::post('admin/routemanagement','AdminController@addRoute');看起来像这样:publicfunctionaddRoute(Request$request){if(Auth::check()){$rules=['flightDep'=>'required','flightArr'=>'required','flightDepTime'=>'required','flightArrTime'=>'required',];$messages=['flig

PHP - 什么是警告 : strpos() [function. strpos] : Empty delimiter in mean?

Warning:strpos()[function.strpos]:Emptydelimiter是什么意思?我有这个:if(strpos(''',$text)===false){$text=str_replace(''',"'",$text);} 最佳答案 我猜,$text是一个空字符串(感谢Mark指出细节)编辑:另外,另一个猜测是您的参数顺序错误。strpos的方法签名是intstrpos(string$haystack,mixed$needle[,int$offset=0])参见http://php.net

php - Mysqli 更新抛出 Call to a member function bind_param() 错误

这个问题在这里已经有了答案:Whattodowithmysqliproblems?Errorslikemysqli_fetch_array():Argument#1mustbeoftypemysqli_resultandsuch(1个回答)关闭3年前。我有一个70/80的字段表单,我需要将其插入到一个表中,所以我没有手动创建一个巨大的插入语句,而是首先根据表单中的输入名称在我的数据库中创建了一个表,这里是代码我用来创建/更改表的functioncreateTable($array,$memberMysqli){foreach($arrayas$key=>$value){//echo"K

c# - '正则表达式' VS 'String Comparison operators/functions'

这个问题是围绕PHP的性能设计的,但如果您愿意,您可以将其扩展到任何语言。在使用PHP多年并不得不比较字符串之后,我了解到在性能方面,在正则表达式上使用字符串比较运算符是有益的。我完全理解,有些操作必须使用正则表达式来完成,直到非常复杂,但对于可以通过正则表达式和字符串函数解决的操作。举个例子:PHPpreg_match('/^[a-z]*$/','thisisallalpha');C#newRegex("^[a-z]*$").IsMatch('thisisallalpha');可以轻松完成PHPctype_alpha('thisisallalpha');C#VFPToolkit.St

php - register_shutdown_function 覆盖

是否可以覆盖已经设置的register_shutdown_function堆栈?像这样的东西:functionf1(){echo"f1";}functionf2(){echo"f2";}register_shutdown_function("f1");echo"actionshere";register_shutdown_function("f2");call_to_undefined_function();//to"produce"theerror在这种情况下,我希望脚本只调用f2()。这可能吗? 最佳答案 你不能直接做,但总有一