草庐IT

string_index

全部标签

php - String as Array 值将在接受为数组的函数中发送

我有一个名为validate()的方法,它接受数组作为参数。例如$v->validate(['username'=>[$username,'required'],'email'=>[$email,'required'],'password'=>[$password,'required'],]);所以我想做的是,为此创建动态参数。虽然不知道正确的术语。例如!$v->validate(['username'=>[$username,'required'],'email'=>[$email,'required'],'password'=>[$password,'required'],$val

php - 无法转换属性路径的值 "fechaReclamacion": datefmt_format: string '' is not numeric

ERROR:Unabletotransformvalueforpropertypath"fechaReclamacion":datefmt_format:string''isnotnumeric,whichwouldberequiredforittobeavaliddate我是一个带有DateTime的对象,在我的表单中我有下一个:->add('fechaReclamacion','birthday',array('input'=>'datetime','widget'=>'single_text','format'=>'dd-MM-yyyy','attr'=>array('place

php - Apache 使用 https 全部重定向到 index.php

我已经阅读了很多关于这个主题的答案,但没有人提到如何结合:将所有流量重定向到index.php+将所有http重定向到httpS以下内容非常适合将所有内容重定向到index.php:RewriteEngineOnRewriteBase/RewriteCond%{REQUEST_FILENAME}!-fRewriteCond%{REQUEST_FILENAME}!-dRewriteCond$1!^(index\.php|public|css|js|robots\.txt)RewriteRule^(.*)index.php/params=$1[L,QSA]在我这样做之前,我能够使用这个强制

php - CodeIgniter 从 url 中删除 index.php

我知道这个问题已经被问过很多次了。但是,我仍然无法摆脱index.php网址。它阻止我直接访问我的Controller。我目前正在使用CodeIgniter2.2.2。以下是我的.htaccess文件:RewriteEngineOnRewriteCond%{REQUEST_FILENAME}!-fRewriteCond%{REQUEST_FILENAME}!-dRewriteRule^(.*)$index.php/$1[L]应用/配置://Findthebelowcode$config['uri_protocol']="AUTO"//Replaceitas$config['uri_pr

php - Codeigniter 链接在 url 中没有 index.php 的情况下无法工作

我开发了一个使用codeigniter的Web应用程序,我的Web应用程序的所有URL结构如下:/Admin/Promotions这种类型的链接在我的Localhost上运行良好,但在我的托管服务器上不起作用(我正在使用Godaddy托管)但是一些在URL中有index.php的链接也在本地主机和服务器上工作,这个链接之王的结构是index.php/Admin/Pramotions我应该怎么做才能使没有index.php的URL正常工作??我的HTACCESS:RewriteEngineOnRewriteCond%{REQUEST_FILENAME}!-fRewriteCond%{RE

php - Twig_Error_Syntax : Unknown "template_from_string" function. 函数已过时?

我记得在composer更新后我遇到了这个错误,但之前它运行良好,并且在比较包版本时我没有发现差异。我在模板中以这种方式使用它:{{include(template_from_string(page.body))}}其中“页面”是来自Controller的实体对象。当前版本是:symfony/symfonyv2.8.15twig/extensionsv1.4.1twig/twigv1.30.0同样在config.yml中:twig:debug:"%kernel.debug%"strict_variables:"%kernel.debug%"form_themes:-'AppBundle

php - 拉维尔 5 : Replace string in query results (Eloquent ORM)

是否可以返回表中的所有列,但如果字符串(值)包含特定单词,则删除该单词?比如我有这样一张表:-------------------------------------------------|id|article_desc|article_link|active||----|------------------|----------------|--------||1|Hello,world!|http://test.co|0||2|ReplaceWordTest|http://null.org|1|-------------------------------------------

php - count() 导致 "unexpected T_STRING"错误?

我正在尝试在WordPress中定义一个新的短代码,但在加载函数时出现以下错误(刚刚加载,我还没有尝试在任何地方调用它):Parseerror:syntaxerror,unexpectedT_STRINGin/pathtomytheme/user_functions.phponline105这是代码;第105行是“$cat_n=count($cats)–1;”:functionusertag_2colcats($atts){extract(shortcode_atts(array('parent'=>0,'depth'=>2,),$atts));$cats=explode('',wp_

PHP/Apache,htaccess 中的选项 +indexes 不适用于根目录

我需要提供我网站的根目录的目录列表,所以我创建了一个.htaccess文件,其中包含options+indexes它适用于子目录,但对于主目录,我得到了RedHatEnterpriseLinux上ApacheHTTP服务器的测试页面页面。我有两个站点,除了安装的PHP版本外,它们完全相同。在一个站点(PHP5.2.1)上,该技术运行良好。另一方面(PHP5.2.9),它没有。据我所知,Apache安装是相同的,并且我验证了httpd.conf文件是相同的。在这两个站点上,htaccess都适用于子目录。我的问题是主站点目录。我的目标是创建基于目录列表的简单网站,类似于znvy.com.

php - Zend_Cache - "Datas must be string or set automatic_serialization = true"

我正在尝试像这样使用Zend_Cache缓存一个数组:$cache=Zend_Registry::get('cache');//$dataisanarray$cache->save($data,'externalData');我收到这个错误:Message:Datasmustbestringorsetautomatic_serialization=true即使在引导文件中初始化Zend_Cache时automatic_serialization设置为真:protectedfunction_initCache(){$frontend=array('lifetime'=>7200,'aut