Example 1 — Write Formatted Text to STDOUT
Pass an array of values and a format string.
<?php
vfprintf(STDOUT, "%s is %d years old" . PHP_EOL, ["Asha", 25]); How It Works
- Choose a stream.
STDOUTis the normal output. - Write placeholders.
%sis for text and%dis for whole numbers. - Pass an array. Values are used in order.
- End the line.
PHP_EOLadds a new line.

