Jump to content

[SOLVED] Small string..can't get the right combo to pull it in.


Modernvox

Recommended Posts

#<a href="(/[a-z]{3}/\d{10}\.html)">#

 

# - opening delimiter

<a href=" - literal string ie find this exact pattern

( - start a new capture group

/ - literal forward slash (as all the links start with a forward slash)

[a-z]{3} - 3 letters

/ - literal forward slash

\d{10} - a 10 digit number

\. - a full stop character (the backslash escapes it as it is a special character)

html - another literal string

) - close capture group

"> - yet more literal characters

# - ending delimiter

 

Wow..finally explained the way i can understand it- Thank You!

If you set $url = "http://newjersey.craigslist.org/sss/"; before calling file_get_contents($url); it should do pretty much the same as the curl approach with substantially less code.

 

Do you use Curl? Can PHP do the same tasks as Curl?

 

I''m still a newbie and wondering if i should even concern myself with curl or stick with php?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.