Concatenate a % (percentage sign) to a variable (string) in PHP

I have what seems to be an easy question for a PHP programmer.

I am trying to concatenate a % (percentage sign) to a variable stored as a string in PHP, however, I can't seem to locate the correct syntax.  

Any help would be appreciated.
$sickTimePercent = (round((($sickTime/$T002_Sum) * $T001_Percent[0]),2))."%";

Open in new window

jsbxpgeAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
jsbxpgeConnect With a Mentor Author Commented:
Hmm, I wonder if we are using different versions.  I am using version 4.4.9.  I found a solution.  "%25%" seemed to work for me.  Thanks for your help.
0
 
kevin_uConnect With a Mentor Commented:
it seems to work for me.. I made up some values.

$sickTime = 1;
$T002_Sum = 40;
$T001_Percent[0] = 100;
$sickTimePercent = (round((($sickTime/$T002_Sum) * $T001_Percent[0]),2))."%";
print $sickTimePercent;

Yields the string 2.5%

0
 
kevin_uCommented:
I tried it with 5.1.6, but hat is very basic syntax that should have worked.
0
All Courses

From novice to tech pro — start learning today.