Right now dates might look something like this 04/18/11 or this 04/08/11.

Well, what needs to be changed and where to not display preceeding 0's in single digit months / days so 04/18/11 becomes 4/18/11 and 04/08/11 would become 4/8/11.. Ty for your time and help.

<?php

$ndnews = file_get_contents('http://www.naughtydog.com/index.php/site/tickerData');

preg_match_all("/<div class=\"message\">\n(.+?)\n<\/d/", $ndnews, $news); 
foreach($news[1] as $item) {
    $Items = explode("  ", $item);
  echo "<span class=\"message\">" . $Items[0] . " - " . $Items[1] . "</span><br />\n"; 
}

?>

Edit: Right now as it stands $Items[0] are the date figures.

Recommended Answers

All 2 Replies

try:

<?php

$ndnews = file_get_contents('http://www.naughtydog.com/index.php/site/tickerData');

preg_match_all("/<div class=\"message\">\n(.+?)\n<\/d/", $ndnews, $news); 
foreach($news[1] as $item) {
    $Items = explode("  ", $item);
  echo "<span class=\"message\">" . preg_replace('#0(\d)/#','$1/',$Items[0]) . " - " . $Items[1] . "</span><br />\n"; 
}

?>

Looks like were good, thx a mil !

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.