Jump to content
php.lv forumi

kā šo pārbaudi pateikt vienkāršāk un labāk?


Pentiums

Recommended Posts

Un kādi plusi ir izmantot explode, nevis parse_str, šajā gadījumā? Salīdzini savu kodu ar šo:

$somevar = "http://www.google.lv/search?hl=lv&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=QHK&q=fraaze+ko+meklee&btnG=Mekl%C4%93t";
$params = array();
parse_str($somevar, $params);
echo $params['q'];

 

Un ir manīts, ka googles refferer saites arī mēdz mainīties, tad explode variants nestrādās korekti.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...