ve lo spiego in poche parole consiste semplicemente nel creare una figura con un simbolo alfabetico ripetuto e poi al centro inserire un testo a piacere, ecco l'output del mio
ecco il codice [ PHP ]
[ot]
[/ot]
Codice:
#############################################################
#___________________________________________________________#
#___________________________________________________________#
#___________________________________________________________#
#___________________________________________________________#
#___________________________________________________________#
#___________________________________________________________#
#___________________________________________________________#
#___________________________________________________________#
#___________________________________________________________#
#___________________________________________________________#
#________________________Ciao mondo!!_______________________#
#___________________________________________________________#
#___________________________________________________________#
#___________________________________________________________#
#___________________________________________________________#
#___________________________________________________________#
#___________________________________________________________#
#___________________________________________________________#
#___________________________________________________________#
#___________________________________________________________#
#___________________________________________________________#
#############################################################
[ot]
PHP:
<?php
// function
function ripeti($ch, $volte) {
$n = 0;
while($n <= $volte){
echo $ch;
$n = $n + 1;
}
}
// START BEGIN CODE
$len = 60; // Insert your Lenght
$height = 20; // insert your height
if($height%2!=0) {
$height = $height + 1;
}
$n = 0;
ripeti("#",$len);
for($n = 0; $n <= $height; $n++) {
echo "</br>";
echo "#";
if($n == ($height/2)) {
ripeti("_",(($len-14)/2));
echo "Ciao mondo!!";
ripeti("_",(($len-15)/2));
}
else {
ripeti("_",($len-2));
}
echo "#";
}
echo "</br>";
ripeti("#",$len);
?>