note 88409 added to features.http-auth

From: Date: Thu, 22 Jan 2009 19:21:59 +0000
Subject: note 88409 added to features.http-auth
Groups: php.notes 
Request: Send a blank email to php-notes+get-149671@lists.php.net to get a copy of this message
Alright, here's the best generic implementation of "http_digest_parse()" : // output is array, from input like: a=abc,b="abc" , c = 'abc def' // "simple" because it can't handle escaped quotes! function ParseSimpleAssignmentString($input) { preg_match_all('@(\w+)\s*=\s*'. '(?:"(.*?)"|\'(.*?)\'|([^,]*?)\s*(?:,|$))@', $input, $matches, PREG_SET_ORDER); $return = array(); foreach($matches as $match) { if(!$match[1]) continue; $data = @$match[2]; if($data=='') $data = @$match[3]; if($data=='') $data = @$match[4]; $return[$match[1]] = $data; } return $return; } ---- Server IP: 64.71.164.2 Probable Submitter: 66.31.43.55 ---- Manual Page -- http://www.php.net/manual/en/features.http-auth.php Edit -- https://master.php.net/note/edit/88409 Del: integrated -- https://master.php.net/note/delete/88409/integrated Del: useless -- https://master.php.net/note/delete/88409/useless Del: bad code -- https://master.php.net/note/delete/88409/bad+code Del: spam -- https://master.php.net/note/delete/88409/spam Del: non-english -- https://master.php.net/note/delete/88409/non-english Del: in docs -- https://master.php.net/note/delete/88409/in+docs Del: other reasons-- https://master.php.net/note/delete/88409 Reject -- https://master.php.net/note/reject/88409 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#149671) next »