/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php function Format($str){ //count arguments that our function received //check if we have sufficient arguments if($count_args==1){return $str;} for($i=0;$i<$count_args-1;$i++){ //get the argument value //replace {$i} with the value of specific argument position } return $str; }
URL: http://www.pedrocorreia.net/mySnippets/php/A-Basic-PHP-String-Format