Jump to content

Why this sign '+' is not being displayed when i fetch it from a mysql database


jd2007

Recommended Posts

By default, the + sign is not printed for positive numbers, but you can force it

 

<?php
$a = array (-20 , 30);

foreach ($a as $num) printf ('%+d<br>', $num) ;
?>

 

-->

-20

+30

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.