[["Name" = "Zs", "age" = "ten", "Sex" and "Nan"],["name" = "ls", "age" = "one", "sex" = "nan"],["name" = > "ww", "Age" and "ten", "Sex" and "NV"], [["Name" + "Zs", "age" = "+", "sex" = "nan"],["name" = "ls", " Age "+", "Sex" and "Nan"],["name" = "ww", "age" = "a", "sex" = "NV"], [["Name" = "Zs", "Age" = " "," "Sex" and "Nan"],["name" = "ls", "Age" and "one", "sex" = "nan"],["name" = "ww", "age" = "ten", "Sex" = > "NV"]]];echo '';p rint_r ($class); Echo '
';? >
This is always wrong, solving.
Parse error:syntax error, unexpected ' [' D:\program files\wamp\www\text.php on line 3
Reply to discussion (solution)
What is your definition of this? Array? It should be defined as your idea.
$class =array ("group1" = (
("Name" = "Zs", "age" = "ten", "sex" = "Nan"),
("Name" = "ls", "age" = "one", "sex" = "Nan"),
("Name" = "ww", "age" = "+", "sex" = "NV")
),
(
("Name" = "Zs", "age" = "ten", "sex" = "Nan"),
("Name" = "ls", "age" = "one", "sex" = "Nan"),
("Name" = "ww", "age" = "+", "sex" = "NV")
),
(
("Name" = "Zs", "age" = "ten", "sex" = "Nan"),
("Name" = "ls", "age" = "one", "sex" = "Nan"),
("Name" = "ww", "age" = "+", "sex" = "NV")
)
)) ;
What is your definition of this? Array? It should be defined as your idea.
$class =array ("group1" = (
("Name" = "Zs", "age" = "ten", "sex" = "Nan"),
("Name" = "ls", "age" = "one", "sex" = "Nan"),
("Name" = "ww", "age" = "+", "sex" = "NV")
),
(
("Name" = "Zs", "age" = "ten", "sex" = "Nan"),
("Name" = "ls", "age" = "one", "sex" = "Nan"),
("Name" = "ww", "age" = "+", "sex" = "NV")
),
(
("Name" = "Zs", "age" = "ten", "sex" = "Nan"),
("Name" = "ls", "age" = "one", "sex" = "Nan"),
("Name" = "ww", "age" = "+", "sex" = "NV")
)
)) ;
Well, the book said not to try to use [] it? I didn't write an array in the book.
Your code requires PHP >= 5.4
What is your definition of this? Array? It should be defined as your idea.
$class =array ("group1" = (
("Name" = "Zs", "age" = "ten", "sex" = "Nan"),
("Name" = "ls", "age" = "one", "sex" = "Nan"),
("Name" = "ww", "age" = "+", "sex" = "NV")
),
(
("Name" = "Zs", "age" = "ten", "sex" = "Nan"),
("Name" = "ls", "age" = "one", "sex" = "Nan"),
("Name" = "ww", "age" = "+", "sex" = "NV")
),
(
("Name" = "Zs", "age" = "ten", "sex" = "Nan"),
("Name" = "ls", "age" = "one", "sex" = "Nan"),
("Name" = "ww", "age" = "+", "sex" = "NV")
)
)) ;
Well, the book said not to try to use [] it? I didn't write an array in the book.
Yes, but the same is true with []
$class [' group1 '][]=array ("name" = "Zs", "age" = "ten", "sex" = "Nan");
$class [' group1 '][]=array ("name" = "ls", "age" = "one", "sex" = "Nan");
$class [' group1 '][]=array ("name" = "ww", "Age" = "n", "Sex" = "NV");
.
.
.
Your code requires PHP >= 5.4
Ah, long knowledge, thank you moderator