Need code for the following Output

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

Post Reply
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Need code for the following Output

Post by vinoth »

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 :!:
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post by Gente »

And what is the problem? What have you tried? :wink:
vinoth
Forum Contributor
Posts: 113
Joined: Thu Aug 02, 2007 3:08 am
Location: India
Contact:

Post by vinoth »

I have no idea for this.

If you have any logic to print this output
All dots should be in center
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post by Gente »

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 »

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
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post by Gente »

???

Code: Select all

<?php
function my_out($str)
{
  echo ".."."<br/>";
  echo ".."."<br/>";
  echo $str."<br/>";
  echo ".."."<br/>";
  echo ".."."<br/>";
}
my_out('.....');
?>
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

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.
Post Reply