Here is a solution that can help you. everytime you want to put a number inside your html page you wrap it with <span class="numbers"></span>
and you add your style in css files like this
.numbers
{
color : red;
/* your code */
}
if you're using php and retreiving data from database, you have to wrap all numbers before you display them. The solution is to create a function that you should apply on every column you got from your database. The function is :
function wrap_numbers($str)
{
preg_match_all('!\d+!', $str, $matches);
foreach ($matches[0] as $key => $value)
$str = preg_replace('/ ' . $value . '/', "<span class='numbers'>" . $value . "</span>", $str, 1);
return $str;
}
Now let's say you have a column in your database that has this value :
$str = "This is a number 123 this is another one 456";
before you print $str
, you have to apply the function like this
$str = wrap_numbers($str);
if you print your $str, you'll get your numbers with different style, and if you want to know what is EXACTLY inside $str you do this
var_dump($str);
and the result is :
string 'This is a number<span class='numbers'>123</span> this is another one<span class='numbers'>456</span>'