草庐IT

not_matched

全部标签

php - 如何读取此 xml,获取 "parser error : CData section not finished"

我正在尝试读取此xml:xmlrssfile但没有成功..有这个错误Warning:simplexml_load_file():http://noticias.perfil.com/feed/:232:parsererror:CDatasectionnotfinishedLasolalecturadelosdatosestadísticosdespinD:\xampp\FerreWoo\scrap-rvnot.phponline43Warning:simplexml_load_file():Isis,conloquehabríalogradounnuevorespaldoasuspro

php - Paypal 订阅 : cost not shown at checkout?

我正在使用适用于php的PayPalSDK。我“认为”一切正常。创建计划->激活计划->创建协议(protocol)->重定向用户同意->执行协议(protocol)。完成了吗?我觉得很奇怪,当用户被重定向到PayPal时,他们根本看不到任何价格,只是要求他们同意。我有设置费,但没有显示,还有每月经常性费用,也没有显示。难道我做错了什么?PayPal是否应该在我执行协议(protocol)后不收取设置费?还是我完全错过了最后一步?(我可以在开发者控制台沙箱通知中看到订阅已设置)我在live上也试过了,也是一样,完全不显示价格。 最佳答案

php - PHP 中的正则表达式 : find the first matching string

我想在非常非常长的文本中找到第一个匹配的字符串。我知道我可以使用preg_grep()并获取返回数组的第一个元素。但是如果我只需要第一场比赛(或者我知道提前只有一场比赛),这样做效率不高。有什么建议吗? 最佳答案 preg_match()?preg_match()returnsthenumberoftimespatternmatches.Thatwillbeeither0times(nomatch)or1timebecausepreg_match()willstopsearchingafterthefirstmatch.preg_m

php - 这是 php 中的快速进程 strpos()/stripos() 或 preg_match()

我只想知道在php中,strpos()/stripos()或preg_match()函数中哪一个会更快。 最佳答案 我找到了thisblog已经对你的问题做了一些测试,结果是:strpos()比preg_match()快3-16倍stripos()比strpos()慢2-30倍stripos()比preg_match()快20-100%无大小写修饰符“//i”在preg_match()中使用正则表达式并不比使用正则表达式快长字符串在preg_match()中使用utf8修饰符“//u”使其慢2倍使用的代码是:

PHP 数组 : summing values with matching dates

我正在尝试弄清楚如何对具有相似日期的多维数组的某些值求和。这是我的数组:2011,'month'=>5,'day'=>13,'value'=>2),array('year'=>2011,'month'=>5,'day'=>14,'value'=>5),array('year'=>2011,'month'=>5,'day'=>13,'value'=>1),array('year'=>2011,'month'=>5,'day'=>14,'value'=>9));?>这是我希望输出的样子:2011,'month'=>5,'day'=>13,'value'=>3//thesumof1+2),a

php - 尝试在 Preg_Match 中查找正斜杠

我已经搜索了几个小时,试图找到解决这个问题的方法。我正在尝试确定REQUESTURI是否合法并从那里分解它。$samplerequesturi="/variable/12345678910";判断是否合法,第一段variable只有字母,长度可变。第二部分是数字,总共应该有11个。我的问题是转义正斜杠,以便它在uri中匹配。我试过:preg_match("/^[\/]{1}[a-z][\/]{1}[0-9]{11}+$/",$samplerequesturi)preg_match("/^[\\/]{1}[a-z][\\/]{1}[0-9]{11}+$/",$samplerequestu

PHP:Preg_match_all 将 html 提取到字符串中

我有这样的html:Tagged:sports,entertain,funny,comedy,automobile,moretags.如何将运动、娱乐、搞笑、喜剧、汽车提取到字符串中我的phppreg_match_all看起来像这样:preg_match_all('/(.*?),/',$this->page,$matches);echovar_dump($matches);echoimplode('',$tags);它不起作用。 最佳答案 我不确定您是如何从中获取$this->page的,但是以下内容应该会如您所料:http://i

php - 错误 : jQuery1830649454693285679_1359620502896 was not called JSON

我已经阅读了很多关于同一问题的问答,但没有一个是我的特定问题(至少我找不到)。我有一个回显json字符串的php脚本header('Content-Type:application/json');echo$result;返回的JSON(使用JSONLint检查并有效):{"Announcement":{"ID":1,"Type":1,"Text":"ThisisatestAlbumsannouncement.","TimeStart":"1969-12-31","TimeEnd":"1969-12-31"}}还有一个读取json的webjquery脚本:$.ajax({type:"GE

PHPExcel : Data validation not working in . xls 格式

我有一个包含两个工作表的excel文件:工作表;列表-将作为列表项显示在Worksheet工作表中的项目列表。请看下面的图片:我想使用PHPExcel库生成它。我已经尝试但没有得到预期的结果。请参阅我的以下代码:$objPHPExcel=newPHPExcel();//Setdocumentproperties$objPHPExcel->getProperties()->setCreator("SoumyaBiswas")->setLastModifiedBy("SoumyaBiswas")->setTitle("Office2007XLSXTestDocument")->setSub

php - 交响乐 2.3 : CollectionRegionDoctrineCommand not found when update vendors and clear cache

在我实现供应商之前一切正常。然后,当我清理缓存时,出现以下错误:PHPFatalerror:Class'Doctrine\ORM\Tools\Console\Command\ClearCache\CollectionRegionCommand'notfoundin/var/app/ondeck/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/CollectionRegionDoctrineCommand.phponline29 最佳答案