草庐IT

existing_start

全部标签

php - 将 array_key_exists 与 preg_match 结合使用

我正在尝试根据模式确定一个或多个匹配项是否存在于数组中,数组的例子:Array([author_id]=>1[channel_id]=>1[site_id]=>1[entry_id]=>6[url_title]=>test_title_with_file2[title]=>TestTitlewithfile[field_id_1_directory]=>1[field_id_4_directory]=>1[submit]=>Submit[entry_date]=>1278219110)我想确定field_id_x_directory键或多个键是否存在,如果存在,则循环遍历每个键并运行一

php - function_exists 每次都返回 false

我正在尝试检查一个函数是否存在,但我的if中总是报错我尝试这样调用函数,其中$function是函数名:if(function_exists($this->module->$function)){$this->module->$function($vars);}else{echo'no';}变量module被定义为应该调用函数的类:$this->module=$module;$this->module=new$this->module;我是不是漏掉了什么?谢谢! 最佳答案 只是可以弄清楚:使用method_exists()解决了我的

php - 使用 Start 和 End 删除 PHP 文件中的字符串

我正在尝试清理已被漏洞感染的WordPress。所有的php文件都在开头添加了这样一行:!#]y84]27]25%x5c%x7824-%x5c%x7824-!%x5c%x7825%x5c%x7824-%x5c%xc^>Ew:Qb:Qc:W~!%x5c%x7825z!>2q%x5c%x7825V#]D6]281L1#%x5c%x782%x7825!?*2b%x5c%x7825)gpf{jt)!gj!#]y3g]61]y3f]63]y3:]68]y76#!#]y7)fepdof.)fepdof.%x5c%x782f#@#%x5c%x782fqp%x5c%x7825>5)qj3hopmA%x

php - Zend_Session : Session must be started before any output has been sent to the browser

我以前遇到过这个问题,但我不记得如何解决它。我已经创建了一个基本的(再简单不过了)Controller,我只是想向浏览器回显一些东西,我收到了这条消息:Fatalerror:Uncaughtexception'Zend_Session_Exception'withmessage'Sessionmustbestartedbeforeanyoutputhasbeensenttothebrowser...这是我的整个Controller。它显示“成功”,但也显示错误消息。我怎样才能使该错误消息静音,以便我可以简单地向浏览器回显一些内容?_helper->layout->disableLayo

php - 第 1 行第 6 列错误 : XML declaration allowed only at the start of the document

我试图构建一个XML文件。但是遇到错误。我包括代码和错误。提前致谢。');while($info=mysql_fetch_array($data)){$support=$xml->addChild('support');$support->addChild('cus_name',$info['com_name']);$support->addChild('ser_type',$info['ser_type']);}Header('Content-type:text/xml');print($xml->asXML());?>显示如下错误Belowisarenderingofthepage

php - WP - 高级自定义字段 : acf_add_options_page() does not exist

我正在尝试在WP中使用高级自定义字段设置选项页面。functions.php文件中的内容:if(function_exists('acf_add_options_page')){acf_add_options_page();acf_add_options_sub_page('General');acf_add_options_sub_page('Header');acf_add_options_sub_page('Footer');}问题是function_exists('acf_add_options_page')返回false。好像没有这个功能,不过我用的是最新版的ACF。当我尝试

php - 组件安装错误 : JInstaller: :Install: File does not exist

我只是按照这个video创建了一个组件.我创建了名为admin.zip的组件。我在joomla3.0中安装时收到以下警告。WarningJInstaller::Install:FiledoesnotexistC:\wamp\www\Content\tmp\install_52009de34a2c1\site\language\en-GB.com_helloworld.iniJInstaller::Install:FiledoesnotexistC:\wamp\www\Content\tmp\install_52009de34a2c1\admin\language\en-GB.com_h

php - 未定义函数 xdebug_code_coverage_started()

我正在尝试获取在命令行上运行的PHP的Xdebug代码覆盖分析,但我收到代码覆盖函数的未定义函数错误。我不使用PHPUnit,而且我不使用IDE。我的文本编辑器是KomodoEdit。我正在使用:Windows8PHP5.4.12Apache2.2.4(但命令行PHP)WAMP我为PHP5.4VC9TS(64位)下载了Xdebug2.2.4,并按照Xdebuginstallpage上的说明进行操作。配置我的电脑。我更改了C:\wamp\bin\apache\Apache2.4.4\bin和C:\wamp\bin\php\php5.4.12中的php.ini文件,使xdebug具有以下设

php - 我不明白 file_exists 和 scandir 是怎么回事

我正在帮助一位friend为他的一个脚本编写一个比较合理的缓存函数。它实际上使用9个不同的SQL查询来获取排行榜数据(其中一个非常费力)我想出了为它创建缓存的想法,开始时是这样的://Cachedirectory$cacheDir="/cache";//Pathtocachedirectory$cachePath="/var/www/html/test";//Bettersafethansorryif(!file_exists($cachePath.$cacheDir)){mkdir($cachePath.$cacheDir,0777,true);}//Cacherebuildswit

php - "Cannot set session ID after the session has started."测试表单时

我正在为我的应用程序编写单元测试。我编写了一个函数来登录不同的用户(以测试用户级别)和一个函数来生成有效或无效的表单数据(以测试我的表单处理)。当测试提交表单时,它抛出一个异常:UncaughtPHPExceptionLogicException:"CannotsetsessionIDafterthesessionhasstarted."我正在使用Symfony2.6.4。我找不到有关此错误消息的任何有用信息。该测试在不久前运行良好。classControllerTestextendsWebTestCase{public$client=null;public$route='home/'