Welcome Guest, Not a member yet? Register   Sign In
problem with loading simplexml class
#1

[eluser]vindhyareddy[/eluser]
Hi folks

I am new to CodeIgniter as well as PHP.

I was working on the example on the following hyperlink:

Link

I am getting the required output.
But,

There is this error popping up along with the output.
Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined offset: 0

Filename: libraries/simplexml.php

Line Number: 229

The code which is throwing an error is :
Code:
226 function array_reindex($array)  
227    {  
228        if (is_array($array)) {  
229            if(count($array) == 1 && $array[0]){  
230                return $this->array_reindex($array[0]);  
231            }else{  
232                foreach($array as $keys => $items) {  
233                    if (is_array($items)) {  
234                        if (is_numeric($keys)) {  
235                            $array[$keys] = $this->array_reindex($items);  
236                        } else {  
237                            $array[$keys] = $this->array_reindex(array_merge(array(), $items));  
238                        }  
239                    }  
240                }  
241            }  
242        }  
243  
244        return $array;  
245    }

Can someone tell me what the problem is?

Thanks,
Vindhya
#2

[eluser]WanWizard[/eluser]
The array you pass in the call to the array_reindex() function doesn't have a value with index '0'.
#3

[eluser]vindhyareddy[/eluser]
So how do I make this work?? I mean how do i take dat error out?
#4

[eluser]vindhyareddy[/eluser]
I came from a php 5.3 version to a php 5.2.x version to remove the error.
Problem solved!




Theme © iAndrew 2016 - Forum software by © MyBB