Interactive Programming Forums
Login
Register
Home
Questions/Snippets/Exercises
Unanswered
Tags
Ask a Question
Post a Code Snippet
Post an Exercise
Welcome to Interactive Programming Forums, where you can ask questions, receive answers from other members of the community, post code snippets and post exercies.
All categories
Ruby
(3)
Python
(10)
PHP
(7)
Perl
(2)
SQL
(8)
Javascript
(6)
HTML
(20)
CSS
(4)
jQuery
(0)
XML
(3)
Code Snippets
(1)
Exercises
(4)
Other
(9)
Warning: array_combine() expects parameter 1 to be array, null given - = - and other error: Undefined variable: mixed
0
votes
PHP → Arraysview exercises
Creating arrays
Examine and try out the following code:
$numbers=array(1,5,10);
$fruits=array('apple','banana','watermelon');
$mixed = array_combine($numbers,$fruits);
echo $mixed[10];
Welcome to Interactive PHP Programming Class
Type clear - to clear the screen
php> $numbers=array(1,5,10);
php> $fruits=array('apple', 'banana', 'watermelon');
php> $mixed = array_combine($numbers,$fruits);
Warning: array_combine() expects parameter 1 to be array, null given
php> echo $mixed[10];
PHP Notice: Undefined variable: mixed
What is wrong at this exercise ???? Please help. Someoane any ideas???
php
programming-code
error
posted
12 years
ago
in
PHP
by
SUNRISER
(
2,050
points)
1 Answer
+1
vote
Thanks for trying out code.he.net Beta.
Please run them as a single line(see below):
php> $numbers=array(1,5,10); $fruits=array('apple','banana','watermelon'); $mixed = array_combine($numbers,$fruits); echo $mixed[10];
Let us know if the problem continues.
answered
12 years
ago
by
codeadmin
(
113,880
points)
Yes, the exception was caused by the compiler compile each line, so that it can not understand $number and $fruits
Related questions
+11
votes
1
answer
How to understand easily the terms of your exercises as a new student who had not such kind of knowledge before?
posted
12 years
ago
in
Exercises
by
chanmg84
(
1,860
points)
programming-code
programming
html
php
+7
votes
1
answer
error in sql exercise Chapter IV - CREATE TABLE 'Employees';
posted
12 years
ago
in
SQL
by
SUNRISER
(
2,050
points)
sql
error
programming-code
–1
vote
1
answer
error in sql exercise Chapter IV - DESCRIBE Employees;
posted
12 years
ago
in
SQL
by
SUNRISER
(
2,050
points)
sql
programming-code
error
+4
votes
1
answer
php script to search mysql database
posted
12 years
ago
in
PHP
by
ansh1990
(
1,640
points)
php
sql
phpmyadmin
+4
votes
1
answer
Python Code Error
posted
12 years
ago
in
Python
by
Manuel Pacheco
(
1,280
points)
python-programming-code
error