Jump to content

[SOLVED] Help with multiplication code


jorge.chavez

Recommended Posts

Hi, I am learning php, I have this code for a multiplication table and is not displaying anything, please let me know what is wrong

 

<html>

<head>

<title>multiplication table</title>

</head>

<body>

<?php

print"<table border="1">\n";

for ($y=1;$y<=12;$y++)

{

print"<tr>\n";

for( $x=1; $x<=12; $x++)

{

print"\t<td>";

print ($x*$y);

print "</td>\n";

}

print "</tr>\n";

}

print "</table>";

?>

</body>

</html>

Link to comment
Share on other sites

backslash escapes that character, like for example if you have ' string's'      its an apostrophe, but you coud go  'string\'s or "string's"  its the same thing

but for longer strings and that, the backslash should be used

 

youll also see it in \n, newline \t ( tab i think)

 

its al over the place

 

 

glad its working

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.