<?php
function Format($str){
//count arguments that our function received
$count_args=func_num_args();
//check if we have sufficient arguments
if($count_args==1){return $str;}
for($i=0;$i<$count_args-1;$i++){
//get the argument value
$arg_value=func_get_arg($i+1);
//replace {$i} with the value of specific argument position
$str=str_replace("{{$i}}",$arg_value,$str);
}
return $str;
}