Cannot index a string index - Why?
| From: | torek | Date: | Thu, 23 Aug 2001 14:55:09 +0000 |
| Subject: | Cannot index a string index - Why? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-64095@lists.php.net to get a copy of this message | ||
hi,
is there an error in this script?:
if ($var){
$tmp = explode("<|>",$vars);
for ($i = 0; $i < sizeof($tmp); $i++){
$struct[$i] = array();
$tmp2 = explode("<||>",$tmp[$i]);
for ($j = 0; $j < sizeof($tmp2);$j++){
$struct[$i][$j] = explode("<|||>",$tmp2[$j]);
}
}
}
$var is something like
"heim<||>test<|||>test1_1<|||>test1_2<|>home<||>testing<|||>testing1_2<|||>t
esting2_2"
Im getting the warning "Cannot index a string index" on line
"$struct[$i][$j] = explode("<|||>",$tmp2[$j]);"
I've done similar things quite often, but this is the first time I get this
warning.
Any Ideas, Thanks
Torek