Search code examples
phppreg-matchpreg-match-all

preg_match find a link


http://example.com/codeThatIHave?killcode=codeIWant

How do I get the code I want using preg_match

tried this

preg_match_all("#killcode=([^=<]+)<#", $page, $del)

but not working


Solution

  • Try :

    preg_match_all("#\?.+?=([^\s]+)#i",$page,$del)