SORU
8 EYLÜL 2010, ÇARŞAMBA


Kaçan %PHP sprintf

Aşağıdaki çıktıyı istiyorum:-

İndirim hakkında from € 27.59 P-Üst hesap.

böyle bir şey yaptığımda:-

$variablesArray[0] = '€';
$variablesArray[1] = 27.59;
$stringWithVariables = 'About to deduct 50% of %s %s from your Top-Up account.';
echo vsprintf($stringWithVariables, $variablesArray);

Ama 50% ya da değiştirilmesi % düşündüğü için bana bu hata vsprintf() [function.vsprintf]: Too few arguments in ... verir. Nasıl kurtulurum?

CEVAP
8 EYLÜL 2010, ÇARŞAMBA


%: başka bir ile kaçmak

$stringWithVariables = 'About to deduct 50%% of %s %s from your Top-Up account.';

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Android Central

    Android Cent

    13 Kasım 2008
  • KSI

    KSI

    25 Temmuz 2009
  • Matthew Morrill

    Matthew Morr

    15 EKİM 2011