Hello World!
Posted: Mon Sep 20, 2010 11:17 pm
Hi to all, brand new to learning PHP. I understand to search and look for these kinds of things before posting, however I have no clue what I would search for in relation to this as I am clearly misunderstanding something. Maybe someone can help me with that. Even just a keyword for me to know exactly what I'm dealing with. In any case, I'm sure someone even brand new may be able to answer this question, and probably a 10 second reply for some of you experts.
I'm vaguely familiar with the fundamentals of 'programming' in general, but best to just call myself a complete noob at this point in time as it's pretty close to knowing nothing
Here's my question and it's very simple I'm sure:
The result is:
"Hello World!
The creator of this script is NOT this person, it's actually THAT t ! "
My question is--- WHY is the second last name ending up as "t" instead of "person" ?
I'd still like to know what is happening here, and where exactly that lowercase 't' is coming from... also, why doesn't this work?
Thanks!
I'm vaguely familiar with the fundamentals of 'programming' in general, but best to just call myself a complete noob at this point in time as it's pretty close to knowing nothing
Here's my question and it's very simple I'm sure:
Code: Select all
<?php $title = "My first HTML page with PHP embedded!";?>
<html>
<head>
<title><?=$title?></title>
</head>
<body>
<?php
$author['first_name'] = "this";
$author['last_name'] = "person";
$author = $author['first_name'] . " " . $author['last_name'];
$realauthor['first_name'] = "THAT";
$realauthor = $realauthor['first_name'] . " " . $author['last_name'];
echo "<h1>Hello World!</h1>\n";
echo "<p>The creator of this script is NOT $author, it's actually $realauthor !<br>\n";
?>
</body>
</html>The result is:
"Hello World!
The creator of this script is NOT this person, it's actually THAT t ! "
My question is--- WHY is the second last name ending up as "t" instead of "person" ?
I'd still like to know what is happening here, and where exactly that lowercase 't' is coming from... also, why doesn't this work?
Thanks!