This question already has an answer here:
- php printf adds number to output 2 answers
I have php code:
$searchTitlePersonType = ($isTravelAgency == true ? "tourists" : "persons");
var_dump($searchTitlePersonType); // Right behavior
The same time, when I try to implement it on my template:
<?php
echo printf( $this->translate("Поиск %s"), $searchTitlePersonType );
?>
I'm taking different unexpected numbers at the end of string: "tourists33" or "persons27". It's not depend of coding page of string and there is a lot of people who find the way to resolve it - do not combine echo printf
in one line of code, but here my question about this problem: WHY does it happen?
Links:
php printf adds number to output
PHP printf adds something after formatted string
</div>