- define: documentation ( source)
- printf: documentation ( source)
<?php
define("MAX",strlen("byebye"));
const SENDOFF = "goodbye";
const START = 4; // position of "b" in goodbye
$temp = SENDOFF;
for ( $i = 0; $i < MAX; $i++ ){
$pos = START + ( $i % 3);
$temp[$i] = SENDOFF[$pos];
}
$temp{$i} = "\0";
printf("%s\n",$temp); // byebye