[SOLVED] Reading a webpage question
Posted: Mon Aug 02, 2004 8:34 pm
Listed below is my program:
When I call this program up in a browser, it will display the entire webpage chair123 with all of its details.
I am trying to get the only the shipping dimensions for the product and I tried adding the following:
I now get the following message:
What I need to do is read into a variable the 30 characters that follow the first instance of "Dimension:"
Is there a php command that will do this?
Thanks!
[Edit: Fixed subject & added php and code tags. --JAM]
Code: Select all
<?php
$word = "test";
$html = file_get_contents('http://www.bigcompany.com/cgi-bin/catalog?va=chair123');
echo $html
?>I am trying to get the only the shipping dimensions for the product and I tried adding the following:
Code: Select all
preg_match("dimensions:", $html, $matches);
var_dump($matches);Code: Select all
Warning: Delimiter must not be alphanumeric or backslash in /var/www/html/nsb/getwordweb.php on line 13
array(0) { }Is there a php command that will do this?
Thanks!
[Edit: Fixed subject & added php and code tags. --JAM]