Jump to content

Recommended Posts

We'll I want to first learn how to code a basic website

 

EDIT:///

 

ok heres some questions I got

<?php
$txt = "Hello World!";
$number = 16;
?>

 

now would that just say on the website "Hello world"

and it would be on line 16.

 

And instead of saying line you say string so string=line?

Link to comment
https://forums.phpfreaks.com/topic/63307-noob/#findComment-315491
Share on other sites

The script does nothing of what you say it'll do. What it'll do is define two variables called txt and number. txt holds a string value of "hello world" and number holds a integer value of 16. It'll do nothing else

 

In order for PHP to display the value of the variables you'll use echo:

<?php
$txt = "Hello World!";
$number = 16;

echo '$txt is: ' . $txt . '<br />';
echo '$number is: ' . $number;

?>

RESULT

$txt is: Hello World
$number is: 16

Link to comment
https://forums.phpfreaks.com/topic/63307-noob/#findComment-315511
Share on other sites

We'll I want to first learn how to code a basic website

 

EDIT:///

 

ok heres some questions I got

<?php
$txt = "Hello World!";
$number = 16;
?>

 

now would that just say on the website "Hello world"

and it would be on line 16.

 

And instead of saying line you say string so string=line?

 

Those are variables. You need to echo them out with echo.

 

Watch the videos at http://www.phpvideotutorials.com you'll find it easy to learn PHP basics.

Link to comment
https://forums.phpfreaks.com/topic/63307-noob/#findComment-315525
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.