you are either able to hard code that information, but if you want to make it dynamic, you can add another element to the text document...
method 1:
code:
<?php
$a = array('blue','white','black');
$c = file_get_contents('./ads.txt');
preg_match_all('/\s*"text"\s*"([^"]*)"/',$c,$m);
echo "<ol>";
for($i=0;$i<count($m[1]);$i++){
echo "<li><span style='color:".$a[$i]."'>".$m[1][$i]."</span></li>";
}
echo "</ol>";
?>
method 2:
text document:
code:
"Advertisements"
{
"1"
{
"type" "S"
"text" "Ad1"
"color" "blue"
}
"2"
{
"type" "S"
"text" "Ad2"
"color" "white"
}
"3"
{
"type" "S"
"text" "Ad3"
"color" "black"
}
}
php file:
code:
<?php
$c = file_get_contents('./ads.txt');
preg_match_all('/\s*"text"\s*"([^"]*)"/',$c,$m);
preg_match_all('/\s*"color"\s*"([^"]*)"/',$c,$a);
echo "<ol>";
for($i=0;$i<count($m[1]);$i++){
echo "<li><span style='color:".$a[1][$i]."'>".$m[1][$i]."</span></li>";
}
echo "</ol>";
?>
hope this help [=