草庐IT

result_name

全部标签

php - 将 2 个正则表达式合并为一个时得到 "two named subpatterns have the same name"

我试图将2个具有相同名称的不同正则表达式合并为一个,但得到的错误消息如下:Warning:preg_match():Compilationfailed:twonamedsubpatternshavethesamenameatoffset276...一个正则表达式如下所示:'%[\s\S]*?(?P[\s\S]*?)%'另一个看起来像这样:'%[\s\S]*?(?P[\s\S]*?)%'我可以毫无问题地按以下方式组合它们:'%([\s\S]*?(?P[\s\S]*?)|[\s\S]*?(?P[\s\S]*?))%'但我不喜欢这种方式,因为我使用了2个名字。我想知道是否有更好的方法来解决这

php - 文件()[函数.文件] : php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

从文件("http://www.otherdomain.com")获取内容时出现以下错误。file()[function.file]:php_network_getaddresses:getaddrinfofailed:Temporaryfailureinnameresolution域服务器是linux。如何解决这个问题? 最佳答案 引用:Ifyou'rehavingproblemswithfopen("url...")butyoucanrun'hosturl'inashellwindowandgetthecorrectlookup

php oci_bind_by_name float

我需要将float绑定(bind)到OCI语句。我在做什么:$price=0.1oci_bind_by_name($resource,'price',$price);在我的Oracle数据库中,“价格”是存储过程的一个参数,它的类型是NUMERIC。执行语句后出现以下错误:Message:oci_execute()[function.oci-execute]:ORA-06502:PL/SQL:numericorvalueerror:charactertonumberconversionerrorORA-06512:atline1如果$price是一个整数,一切正常。在PHP文档中htt

php - 给出警告 : mysql_result() expects parameter 1 to be resource, bool 值

我知道我们已经有很多关于这个错误的问题,但我无法修复我的代码,所以这里的任何人都请帮助我解决这个问题。我的代码是这样的functionlogin($username,$password){$user_id=user_id_from_username($username);$username=sanitize($username);$password=md5($password);return(mysql_result(mysql_query("SELECTCOUNT(`user_id`)FROM`users`WHERE`username`='$username'AND`password

PHP 字符串比较 : odd result, 可能的类型杂耍,不知道为什么

我知道数字字符串可能在PHP中被打乱类型,但我不明白为什么它会在这里发生或给出这个结果:$a="00010010001101000000101";$b="00010010001101000000001";$c=(($a==$b)?"true":"false");$d=(($a===$b)?"true":"false");echo$c."".$d."\n";//truefalse但在这种情况下,$a和$b的定义方式相同,长度相同,但内容不同,其中有许多字符。如何($a==$b)评估为真? 最佳答案 这是一个错误。在http://3v4

php - curl 错误 (35) : error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 unrecognized name

我一直在使用以下代码块通过cURL从HTTPS网站收集数据。$q='https://www.example.org/';//forexample$ch=curl_init();curl_setopt($ch,CURLOPT_URL,$q);curl_setopt($ch,CURLOPT_RETURNTRANSFER,TRUE);curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,0);curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE);curl_setopt($ch,CURLOPT_FOLLOWLOCATION,TRUE

php - "Object named IIS_IUSRS could not be found"将用户添加到 PHP session 目录 iis 8

我正在运行运行IIS8的WindowsServer2012R2。整个WindowsServer环境的新功能。要安装PHP,我将遵循以下教程InstallandConfigurePHP其中一部分说,为了正确使用PHP的session功能,我需要创建一个新文件夹“sessions”并将“IIS_IUSRS”添加到该文件夹​​。但是,当我在“对象文件框”中输入相同内容时,出现“未找到名为IIS_IUSRS的对象”错误。到目前为止,我已经提到了以下内容,但没有一个有帮助TryingtoaddIIS_IUSRStoAdministratorsgroup[closed]IISorIIS_IUSRS

phpass 的自定义 base 64 编码器 : does it have a name/advantage over Base64?

phpass在encode64()中使用了一个奇怪的(对我来说)算法以base64编码。Base64和Uuencode线性分块6位以在映射到可打印字符之前生成每个八位位组。encode64随机排列位:inputbitlocation:abcdefghijklmnopqrstuvwxbase64bitlocation:..abcdef..ghijkl..mnopqr..stuvwxencode64bitlocation:..cdefgh..mnopab..wxijkl..qrstuv这个算法是众所周知的吗?除了向后兼容,为什么选择它而不是Base64?下面我重写了它以阐明算法:funct

php - pg_free_result() 是否必要,即使结果超出范围?

PHP文档对pg_free_result()有这样的说法:Thisfunctionneedonlybecalledifmemoryconsumptionduringscriptexecutionisaproblem.Otherwise,allresultmemorywillbeautomaticallyfreedwhenthescriptends.http://www.php.net/manual/en/function.pg-free-result.php我会(也许天真地)期望通过调用pg_query()返回的资源在超出范围时被垃圾回收。在这样的假设函数中:functionselec

Php,更改session.name后,每次加载时 session ID都会更改

我有一个关于session名称和sessionID的奇怪错误。我已经使用ini_set()将session.name从PHPSESSID更改为'AAA'同时ini_set()在session_start()之前设置厌倦了使用session_name()代替,结果相同在我这样做之后,每当我加载页面时,session_id()都会返回不同的ID。我改回来后,又可以正常工作了。我可以帮忙解决这个问题吗?非常感谢!!更新解决方案:Cannotchangephpsessioncookiename 最佳答案 您是否尝试过$mySession=s