matthew61773 Posted August 23, 2006 Share Posted August 23, 2006 Hi I am doing a question in college and need some simple code in PHP.I have to Write a PHP script that outputs your name to the screen 5 times, each time the font size increasing by 2. Any ideas?thanks :) Quote Link to comment Share on other sites More sharing options...
Orio Posted August 23, 2006 Share Posted August 23, 2006 How do you get the name?Orio. Quote Link to comment Share on other sites More sharing options...
matthew61773 Posted August 23, 2006 Author Share Posted August 23, 2006 my own name or a name typed into the code. Quote Link to comment Share on other sites More sharing options...
lessthanthree Posted August 23, 2006 Share Posted August 23, 2006 There's a million ways to do this but....[code=php:0]$myName = "Phil P";$fs = "10";print "<ul>";for ($i = 0; $i <= 4; $i++) { print "<li style='font-size:".$fs."px'>".$myName."</li>"; $fs = $fs+2;}print "</ul>";[/code] Quote Link to comment Share on other sites More sharing options...
Orio Posted August 23, 2006 Share Posted August 23, 2006 [code]<?php$name="matthew61773";$font=10;$i=0;while($i<5){echo('<font size="'.$font+($i*2).'">'.$name.'</font><br>');$i++;}?>[/code]Orio. Quote Link to comment Share on other sites More sharing options...
matthew61773 Posted August 23, 2006 Author Share Posted August 23, 2006 Thanks guys much appreciated ;D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.