php - preg_match_all /(\w ):[^\/]/ not work -


i want pattern url : (\w+):[^\/]+ doesn;t work in php :(

in url string : http://azera/admin/filemanager/index/cmd:download/file:rjpcyxplcmfcum91dgvylnhtba==

i must array :

array (size=2)   'cmd' => string 'download'   'file' => string 'rjpcyxplcmfcum91dgvylnhtba==' 

but php returns null ! php code :

preg_match_all('/(\w+):[^\/]+/',$url,$passedargs);              // passedargs 

how can fix ?

i'm not sure mean null!, want array:

array (size=2)   'cmd' => string 'download'   'file' => string 'rjpcyxplcmfcum91dgvylnhtba==' 

while regex: (\w+):[^\/]+ capturing cmd , file. need change regex to:

\w+:([^\/]+) 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -