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

  • Jose LviS el Bambino ( JLB )   LviSito

    Jose LviS el

    3 ŞUBAT 2008
  • DetroitBORG

    DetroitBORG

    29 Temmuz 2008
  • MrExcite96

    MrExcite96

    17 ŞUBAT 2011