Jump to content

PHP genius needed

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
adzeds

adzeds

    Newbie

  • Members
  • PipPip
  • 27 posts
I need help from a PHP master!

I am trying to get the search keywords from a google image search result but am having great problems.

Here is an example of the referral url:
http://images.google.it/imgres?imgurl=http://www.eaguingamp.co.uk/wp-content/uploads/2009/03/logo_coupe_de_france.jpg&imgrefurl=http://www.eaguingamp.co.uk/2010/02/09/cdf-boulogne-a-preview/&usg=__GhT0TcW-SiSBtx6-TuR_EKQB-Uw=&h=241&w=237&sz=38&hl=it&start=6&sig2=alRzLqtodZqLOEb0dgbVlw&um=1&itbs=1&tbnid=6Mz7HeF8nEFv7M:&tbnh=110&tbnw=108&prev=/images%3Fq%3D[COLOR=Red]coupe[/COLOR]%2B[COLOR=Red]de[/COLOR]%2B[COLOR=Red]france[/COLOR]%26um%3D1%26hl%3Dit%26sa%3DN%26tbs%3Disch:1&ei=8FuOS5HYOIuI_Aa3gO3kDA

The words in red show where the search keywords are in the string. I need to extract those so that I can save them in a database, how can this be done?

I have tried using preg_match but I am hopeless with it. Hope someone can help ASAP

#2
adzeds

adzeds

    Newbie

  • Members
  • PipPip
  • 27 posts
Non-one has the answer?

#3
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
I'd try this preg pattern: "/%3D(.+?)%26/", that way, you get out "coupe%2Bde%2Bfrance"
then I'd do a explode on "%2B" to get all parts of the query.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall