I'm starting to code a CMS, and I am new to PHP. I am just trying this for fun, and I don't have any plans of putting it up live (unless it turns out really great). However, I am already stuck! I am coding the settings.php file right now, and am trying to put some basic text values in it. So far I have,
$text = array(
t1 = "Welcome to ".$siteName."!",
t2 = "Sorry, but you must be registered to login!",
t3 = "Welcome back, ".$userName."!",
t4 = "See you soon!",
t5 = "Your last login was",
t6 = "News",
);
So, I built index.php with this code.
<?php
require_once('settings.php');
$siteName = 'Test app';
echo $text[t1];
?>
However, I get the following error.
Parse error: syntax error, unexpected '=', expecting ')' in ###### on line 27
What is wrong with the array code?
Thanks for any and all help,
Keith
remove your comma after the last element.
Okay, it worked! Thanks!