1. Home
  2. ›
  3. Php
  4. ›
  5. Sprintf

Lets you format a string and combine it with variables.

#php
$day = date("l");
$year = date("Y");

echo sprintf('Current year: %s. Current day %s', $year, $day);
copy
Full Php cheatsheet