0

I have this sprintf based string:

<?php echo sprintf( 'Over %1$d (warning) and %2$d (bad) are recorded', 75, 90 ); ?>

It outputs:

Over 75 (warning) and 90 (bad) are recorded

How can I make this string be:

Over 75% (warning) and 90% (bad) are recorded

I thought I could use:

<?php echo sprintf( 'Memory over %1$d% (warning) and %2$d% (bad) are recorded', 75, 90 ); ?>

But the % on the end of %1$d% and %2$d% interfere with the sprintf function and result in:

Memory over 75warning) and 90bad) are recorded

bigdaveygeorge
  • 947
  • 2
  • 12
  • 32

0 Answers0