sprintf() problem

From: Date: Wed, 10 Jul 2002 17:13:55 +0000
Subject: sprintf() problem
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-11259@lists.php.net to get a copy of this message
When I use sprintf() and I need to justify a string to the right for example $strformatted = sprintf( "Example %50s","Hello"); print $strformatted; This doesn´t work, the function doesn´t put the blank spaces before the word Hello. This will print ExampleHello If I do this does work but I need blank spaces, that it´s supposed to be the default character $strformatted = sprintf( "Example %'x50s","Hello"); print $strformatted; this wil print Examplexxxxxxxxx...Hello I ran this test in two different servers running PHP, one with Windows XP and another with Linux Thank you very much.

« previous php.mirrors (#11259) next »