# Printf() function

**URL:** <https://forum.kirupa.com/t/printf-function/173618>\
**Category:** Uncategorized\
**Created:** [December 27, 2005, 11:33pm UTC](https://forum.kirupa.com/t/printf-function/173618 "2005-12-27T23:33:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bongbox](https://avatars.discourse-cdn.com/v4/letter/b/0ea827/32.png) [@bongbox](https://forum.kirupa.com/u/bongbox)\
**Post date:** [December 27, 2005, 11:33pm UTC](https://forum.kirupa.com/t/printf-function/173618/1 "2005-12-27T23:33:53Z")

</div>

i start reading oreilly learning php 5 and stumble to this function printf() i read it and i dont understand what’s this function does i know that it format strings but the arguments that it pass like this one … i dont get it can anyone explain it please…oh btw merryxmas every1:

```php

$hamburger = 4.95;

$milkshake = 1.95;

$cola = .85;

$food = 2 * $hamburger + $milkshake + $cola;

$tax = $food * .075;

$tip = $food * .16;

printf("%1d %9s at \$%.2f each: \$%.2f
", 2, 'Hamburger', $hamburger, 2 * $hamburger);

printf("%1d %9s at \$%.2f each: \$%.2f
", 1, 'Milkshake', $milkshake, $milkshake);

```
