Ok. I am new to PHP and I am coming from a strictly c, cpp, perl background. So, the language is pretty familiar and I am having a great time time learning...BUT...I am having some problems with the list() function.
Here is some code:
<?
$USERDB = fopen("users.db", "r");
while ($line = fgets ($USERDB, 4096))
{
list ($name, $occupation, $favcolor) = split ("|", $line);
print ("Name: $name<br>");
print ("Job: $occupation<br>");
print ("Favorite Color: $favcolor<br>");
}
fclose ($USERD😎;
?>
END CODE
And here is whats in the text file:
Van Tate|Software Engineer|Green
END TEXT FILE
Pretty simple, eh? Now...when I execute the script I get this error:
Warning: bad regular expression for split() in /var/www/html/v2/getusers.php on line 7
I dont see the problem.