yeah but heres where im a lil confused and I bet alot of others new to simple html DOM.
this below..... " on the fly"...
$item['link'] = $article->find('a',0)->href;
returns what?? to place below..
Like?.. $link= '$item['link']"; ????
or $link='what exactly goes here?';
$link = 'www.mysite.com/yabadaba1204993 NEEDS to go here but on the fly is it.. $item['link']'; //??????????
$last7 = substr($link,-7);
echo "The last 7 characters of the string are: $last7";
or even
$last7 = substr($link,-7); // could it be $last7 = substr($item['link'],-7);
heres my code..
<?php
include('simple_html_dom.php');
// Create DOM from URL or file
$html = file_get_html('http://mysite.com/yabadabaexample.html');
foreach($html->find('table.results') as $article) {
$item['image'] = $article->find('img[class=thumbnail]',0)->src;
$item['title'] = $article->find('strong',0)->plaintext;
$item['details'] = $article->find('div[style=margin-top:5px]',0)->plaintext;
$item['price'] = $article->find('td[id=price]',0)->plaintext;
$item['timestamp'] = $article->find('td[width=13%]',0)->plaintext;
$item['link'] = $article->find('a',0)->href;
$item['number'] = $article->find('a',0)->href;
// $item['link'] = $article->find('a',0)->href;
//pulls http://mysite.com/yabadabaexample1448126
//?? $last7 = substr($item['link'],-7);
//or could this work??
//$item['link'] = $article->find(('a',0),-7)->href; ????
$articles[] = $item;
}
print_r($articles);
?>
the above you gave me is simple part, its how to actually call the link on the fly Im looking for. Dont get me wrong! thanks for reply.. its just need a little more than that.