草庐IT

unary_function

全部标签

php - fatal error : Uncaught Error: Call to undefined function ereg_replace() PHP 7

这个问题在这里已经有了答案:HowcanIconverteregexpressionstopreginPHP?(4个答案)关闭3年前。下面的代码给我php7中的fatalerror$jquery_click_hook=ereg_replace("[^A-Za-z0-9]","",strtolower($value['name']));有什么方法可以让它与php7兼容吗?

php - 警告 : session_start() [function. session 启动]:无法发送 session 缓存限制器

我这里的Session_start()有问题:警告:session_start()[function.session-start]:无法发送session缓存限制器-header已发送(输出开始于C:\xampp\htdocs\pages\home.php:4)在C:\xampp\htdocs\charts\home-chart.php行2在第2行的home-chart.php中,我编写了如下代码:session_start();...echo'username:'.$_SESSION['user_name'];虽然有这个警告我可以得到$_SESSION['user_name']的结果

php - fatal error : Call to undefined function oci_connect()

我没有注释下一行(在我的php.ini中):extension=php_oracle.dllextension=php_oci8.dll然后我下载了这个文件instantclient-basiclite-nt-11.2.0.2.0.zip并解压缩并将其放在驱动器D...我正在使用WindowsXP我这样设置环境变量:LD_LIBRARY_PATHC:\instantclient_11_2:$LD_LIBRARY_PATHORACLE_HOMEC:\instantclient_11_2但是当我执行oci_connect()函数时,我看到了这个错误:Fatalerror:Calltound

php - 匿名函数不起作用 : Function name must be a string

我有:PHPVersion5.4.20'./configure''--disable-fileinfo''--enable-bcmath''--enable-calendar''--enable-ftp''--enable-gd-native-ttf''--enable-libxml''--enable-mbstring''--enable-pdo=shared''--enable-soap''--enable-sockets''--enable-zip''--prefix=/usr/local''--with-apxs2=/usr/local/apache/bin/apxs''--w

php - Zend 框架 2 Rest API : Calls getList() instead of get($id) function

以下是我的模块配置文件returnarray('controllers'=>array('invokables'=>array('RSMobile\Controller\User'=>'RSMobile\Controller\UserController',),),//RoutesforAPIcalls'router'=>array('routes'=>array('rsmobile'=>array('type'=>'segment','options'=>array('route'=>'/rsmobile','defaults'=>array('controller'=>'RSMob

php - fatal error : Call to undefined function http_get()

我尝试使用http_get在php编码中进行跨域请求。在我的服务器中,没有安装必需的模块。我不知道要安装什么才能执行http_get。我得到的错误是Fatalerror:Calltoundefinedfunctionhttp_get()inC:\xampp\htdocs\article\index.phponline2我尝试这样做(PECLpecl_http>=0.1.0)http_get—执行GET请求但是,我没有找到解决办法。所以,请帮我运行http_get编码。提前致谢。 最佳答案 我认为您必须在php.ini文件中启用ext

php - 'function' 和 'use' 以及 'array_filter' 在 PHP 中如何工作?

我熟悉创建一个放在.php文件顶部的PHP函数,例如:functionmy_little_function($parm1,$parm2){if($parms然后这样调用它:$result=my_little_function("1","2");echo"Theansweris$result."."\n";我有一些代码,不是我写的,它在像上面的my_little_function这样的函数的传统用法中同时使用了“function”和“use”。我对此感到困惑,并向您这些更有经验的PHP开发人员提出一些问题。这是我所指的工作PHP代码的一部分:$neededObject=array_fil

PHP 最佳实践 : repass variables from config file when calling functions or use global?

我有一个在多个站点上使用的程序。它使用require('config.php');设置任何站点相关变量,如mysql连接信息、路径等。假设我在一个函数中使用了这些依赖于站点的变量之一,例如$backup_path。这个变量最初是在config.php中声明的,并没有出现在主程序文件中。我需要在函数ma​​kebackup($table_name);中访问这个变量(也在一个单独的functions.php文件中)。是不是比较好说makebackup('my_table');然后在函数内部使用“global$backup_path”,还是调用函数更好makebackup('my_table

php - disable_functions php.ini eval 函数仍然有效

我在试图禁用我的php.ini中的某些功能时遇到了一个小问题。首先,我不是服务器的所有者,所以我无法更改主php.ini配置。但是我试图用服务器所有者给我的指令来改变它。这是我在我创建的php.ini文件中放入的行disable_functions=eval,exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source在我的phpinfo()中,我可以在本地值和主值中看到这些功能被禁用。但我的问题从这里开始。在女巫的同一个文件中,我运行phpinf

php - 当 functions.php 中需要父文件时如何覆盖子 Wordpress 主题中的父文件

我对设计和编码Wordpress主题相当陌生,最近开始了一个基于悉尼主题的child主题,该主题在Wordpress中免费提供。我遇到了无法解决的问题。有一个PHP文件正在通过父主题的functions.php调用,我需要对其进行自定义,并且在更新父主题时需要保持不变。此文件名为template-tags.php,位于“inc”文件夹内。现在,据推测,根据Wordpress法典(我在这里询问之前已经查阅过),子主题上的任何重复文件(functions.php除外)将自动覆盖父主题中的文件。我不知道这是否适用于文件夹内的文件,但我认为这个特定文件在父级的functions.php中被调用