How does one do a string replace on say item['title']
let says a title says THIS IS THE TITLE 12:20pm
and you want all the 12:20pms to be replaced with blanks.
I know the coding for string replace but where would you put it in a find $item['title'] = $article->find('strong',0)->plaintext;
or also string replace on blanks in a title.. like THIS IS THE TITLE 1 2:20pm
anyone know?
<?php
include('simple_html_dom.php');
// Create DOM from URL or file
$html = file_get_html('http://oneofmysites.com/stuffineedthisisjustafakeforpostinghere.html');
foreach($html->find('table.resultsTable') 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;
$articles[] = $item;
}
//just to check below
//print_r($articles);