PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
vinoth
Forum Contributor
Posts: 113 Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:
Post
by vinoth » Thu Aug 02, 2007 3:15 am
hi all
I am Vinoth
New to PHP Programming.
I want the PHP code to display the following dot output
. .
. .
. . . . .
. .
. .
first,second,fourth & fifth row contains two dots
Middle row contains 5 dots..
Is there any possible to display this output using PHP
Thanks in advance
Gente
Forum Contributor
Posts: 252 Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:
Post
by Gente » Thu Aug 02, 2007 3:20 am
And what is the problem? What have you tried?
vinoth
Forum Contributor
Posts: 113 Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:
Post
by vinoth » Thu Aug 02, 2007 3:22 am
I have no idea for this.
If you have any logic to print this output
All dots should be in center
Gente
Forum Contributor
Posts: 252 Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:
Post
by Gente » Thu Aug 02, 2007 3:25 am
Code: Select all
<?php
echo ".."."<br/>";
echo ".."."<br/>";
echo "....."."<br/>";
echo ".."."<br/>";
echo ".."."<br/>";
?>
vinoth
Forum Contributor
Posts: 113 Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:
Post
by vinoth » Thu Aug 02, 2007 3:28 am
we should not print like this
Our code should be generalise
it should be furthur added by two dots at the beginning and end.
I want an generalise code for that
Gente
Forum Contributor
Posts: 252 Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:
Post
by Gente » Thu Aug 02, 2007 3:48 am
???
Code: Select all
<?php
function my_out($str)
{
echo ".."."<br/>";
echo ".."."<br/>";
echo $str."<br/>";
echo ".."."<br/>";
echo ".."."<br/>";
}
my_out('.....');
?>
onion2k
Jedi Mod
Posts: 5263 Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com
Post
by onion2k » Thu Aug 02, 2007 4:00 am
vinoth wrote: we should not print like this
Our code should be generalise
it should be furthur added by two dots at the beginning and end.
I want an generalise code for that
Unless you can explain what you need to do in a way that's not ambiguous then noone is going to be able to help you. What you've said here doesn't explain what the problem is.