String Manipulation
| From: | S. Cole | Date: | Sat, 31 May 2003 21:52:47 +0000 |
| Subject: | String Manipulation | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-149682@lists.php.net to get a copy of this message | ||
Hello all,
I'm currently working on a site for my brother-in-law. I have written a
script that will access a website
(http://www.remax.nf.ca/listings.asp?a=163&cp=1) and pull the page into a
variable ($var). I have striped the page down to include only the listings
(still in HTML and table format).
Sample...
HTML FORMAT: (view source for html code)
http://205.251.209.142/temp/listing.html
HTML STRIPPED:
"276A Conception Bay Highway $260,000.00 0 Bedrooms, 0 Bathrooms View
Details 170 Salmon Cove Road $185,000.00 3 Bedrooms, 2 Bathrooms View
Details + Interior Photos Main Road, Bristols Hope $109,000.00 3 Bedrooms,
2 Bathrooms View Details 14 Mercers Cove, Bay Roberts $99,900.00 3
Bedrooms, 2 Bathrooms View Details 83-85 Seymours Road $94,500.00 4
Bedrooms, 2 Bathrooms View Details + Interior Photos 208 A Neck Road
$69,900.00 3 Bedrooms, 1 Bathrooms View Details 165 Water Street
$69,900.00 3 Bedrooms, 2 Bathrooms View Details 384 Water Street, Harbour
Grace SALE PENDING $67,000.00 3 Bedrooms, 1 Bathrooms View Details +
Interior Photos 95-97 Conception Bay Highway $65,000.00 3 Bedrooms, 1
Bathrooms View Details Old Track Road $59,500.00 0 Bedrooms, 0 Bathrooms
View Details Page 1 of 3 Previous | Next"
What I want to do, is to be able to work with this data. I don't want to
keep it in the same format as it's on the original site.
I would like to be able to pull the listings and it's components separately
so that I can change the layout, color, size, font, etc, etc, etc.
Also, under the html format, there are links to other sites and pictures
that I would like to be able to pull as well. I would need to be able to
know which listing the link and/or picture was for as not all listings will
have a picture.
If anyone can help, It would be greatly appreciated. I have been pulling my
hair out trying to find a way to do this. I've been studying regular
expressions, however am not familiar enough with them to be able to get it
to work.
Thanks in advance,
S. Cole
ANTI-SPAM: to reply, delete "REMOVE" from email address.
ps. I know I posted the same question in alt.php, found this newsgroup after
and there's more activity.