Jump to content

[SOLVED] How to use %s ("string placeholder")


lordvader

Recommended Posts

It is involved with the printf function (and sprintf, vsprintf, etc).

http://www.php.net/printf

^^^ That has all the codes that you need. 

 

But here are examples:

$lol = "Lol";

$num = 42;

 

printf("My favorite number is %d and I love to %s", $num, $lol); //Prints "My favorite number is 42 and I love to Lol"

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.