str_get_html and simply html dom

shawnwhite

New Member
way after str_replace function $img is empty and secont $img->find('img') function show error:\[code\]Fatal error: Cannot use object of type simple_html_dom as array in D:\wamp\www\test.php on line 7 <?phprequire_once('simple_html_dom.php');$img_html = str_get_html('hhtml tekst html tekst <img src = "http://stackoverflow.com/questions/3824498/img.png" /> ad sad');foreach($img_html->find('img') as $element) $img[] = $element->src . '<br>';$img_html = str_replace($img[0], 'n-'.$img[0], $img_html); foreach($img_html->find('img') as $element2) echo $element2->src . '<br>';?>\[/code\]
 
Back
Top