草庐IT

no-match

全部标签

php - Doctrine: No alias was set before invoking getRootAlias() 错误

我的原始查询是:Select*fromuseruinnerjoincompanyconu.company_id=c.idwhereu.id=2我把它变成了:$em=$this->get('doctrine')->getEntityManager();$qb=$em->createQueryBuilder();$qb->select('u')->from('TemplateManager\Bundle\DocumentGeneratorBundle\Entity\Useru')->innerjoin('u.company')->where('u.id='.$id);$query=$qb-

php - 如何区分 "unset"和 "no-assignment"为 NULL 值?

在本例中的php中——但实际上在一般编程中,有没有办法区分null的“无赋值”和“未设置值”命令合并2个相同类型的不可变数据对象时的值?考虑这个php类,它是一个不可变的数据对象。它在其构造函数中接受一个字符串和一个整数,并且只为值提供访问器:classData{protected$someNumber;protected$someString;publicfunction__construct(?int$someNumber,?string$someString){$this->someNumber=$someNumber;$this->someString=$someString;

php - php 中的 preg_match

我想使用preg_match()这样给定字符串中就不应该有特殊字符,例如``@#$%^&/'`。例如:编码:输出有效:输出无效(以空格开头的字符串)项目管理:输出有效(两个词之间的空格有效)'Design23':输出有效23Designing:输出无效123:输出无效我尝试了但无法得出有效答案。 最佳答案 像这样的正则表达式有帮助吗?^[a-zA-Z0-9]\w*$意思是:^=这个模式必须从字符串的开头开始[a-zA-Z0-9]=此字符可以是任何字母(a-z和A-Z)或数字(0-9,另见\d)\w=单词字符。这包括字母、数字和空格(

php - 未捕获的类型错误 : Object [object Object] has no method 'highcharts'

我正在尝试向我现有的网站添加一个图表,我已经在一个新网站上测试过它并且它有效,但是当我将它添加到我自己现有的网站时它给了我一些错误:代码来自highchart。我的代码错误以粗体显示:$(function(){$('#container').highcharts({*UncaughtTypeError:Object[objectObject]hasnomethod'highcharts'chart:{type:'column'},title:{text:'Chart'},xAxis:{categories:['Apples','Bananas']},yAxis:{title:{text

php - 身份验证凭证未找到异常 : The security context contains no authentication token

我收到以下错误AuthenticationCredentialsNotFoundException:Thesecuritycontextcontainsnoauthenticationtoken.OnepossiblereasonmaybethatthereisnofirewallconfiguredforthisURL.我已经尝试过解决方案,因为我知道当没有为路由配置安全防火墙时会发生此错误,但我似乎无法解决该错误。这是我的security.ymlsecurity:access_decision_manager:#strategycanbe:affirmative,unanimous

php - preg_match_all html 标签,双引号或单引号中的标签除外

给定这个DOM$html=Bye","info":"Wewin"}'>TheAAnythinghere"}'>EOD;我正在尝试使用此表达式来preg_match_allhtml标签:$tags=array();if(preg_match_all('~]*>|~im',$html,$matchall,PREG_SET_ORDER)){foreach($matchallas$m){$tags[]=$m[0];}}print_r($tags);这个表达式的输出是:Array([0]=>[1]=>[2]=>[3]=>[4]=>[5]=>[6]=>[7]=>[8]=>[9]=>[10]=>[1

php - 正则表达式(php 中的 preg_match): last groups in the output array don't work correctly

使用这种模式:(howis\s)?(the\s)?(weather)\s?((on)\s)?(today|tomorrow|sunday|monday|tuesday|wednesday|thursday|friday|saturday|sunday|thisweek)?(\s(in)\s(.*)\s?(on)?\s?(today|tomorrow|sunday|monday|tuesday|wednesday|thursday|friday|saturday|sunday|thisweek)?)?这就是我要捕捉的东西输入:维也纳星期二的天气怎么样输出:array(100=>howis

来自 Array with Multine 的 PHP 正则表达式 preg_match 不匹配所有 block

想知道是否有人可以帮助我使用以下正则表达式,我无法匹配blockmultineCF.{CoordonneesAbonne}:在PHP的preg_match函数中使用时。奇怪的是,当我在线执行正则表达式时,尽管该block在另一个组中,它似乎仍然有效regex101example这是代码:sourcecode'CF.{Temps}:1',2=>'CF.{Etat}:return',3=>'CF.{Code}:2',4=>'CF.{Values}:plaque',5=>'',6=>'CF.{Coordonnees}:LAPERSONNE',7=>'',8=>'10000LAVILLE',9

php - 在我的部分页面上使用 Php 到 "No cache"的方法?

我的网站页面上有一个表单。我有一个从提交表单回显的表,我不想缓存它,因为当您输入表单时,缓存的版本会显示并且不会更新。有没有比元标记不缓存页面更好的方法?我现在使用的代码是';while($row=mysql_fetch_array($result)){echo"".$row['title']."-".$row['name']."".$row['class']."";}echo'';?> 最佳答案 参见http://php.net/manual/en/function.header.php

php - preg_match_all( ) 在不同的服务器上表现不同

下面的代码在我的PC上的XAMPP上运行完美,但在我新买的VPS上不起作用。它使我的代码崩溃。preg_match_all("/$regex/siU",$string,$matches,PREG_SET_ORDER);这应该只是从HTML中获取链接和标题。以前,今天也出现过类似的正则表达式问题。代码在本地服务器上运行良好,但在vps上创建“连接已重置”错误。该问题是由一些注释的html(其中包含php代码)引起的,使用以下代码将其删除以优化输出,但即使连接重置的问题已解决,HTML在浏览器源代码中仍然有注释。$string=preg_replace('//','',$string);那