Re: Language class for PEAR?

From: Date: Wed, 03 Apr 2002 17:17:06 +0000
Subject: Re: Language class for PEAR?
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-5182@lists.php.net to get a copy of this message
> > Sorry for the really delayed response, but this can be done as follows: > > > > EN: $format="Welcome %s to %s!"; > > sprintf($format, $APP, $USER ); > > > > DE: $format = "Willkommen %2$s, %1$s!"; > > sprintf($format, $APP, $USER ); > > > > Bascially, that functionality is built into sprintf(). > > But not in PHP's *printf. It's a great feature though, someone should > implement it. :-) Sure it is: <?php $name = 'Stig'; $app = 'PHP'; printf('Welcome %s to %s!', $name, $app); printf('Welcome to %2$s, %1$s', $name, $app); ?> - Colin

« previous php.pear.dev (#5182) next »