Output $line that produces error and check it. If $line do not have "=" sign, list($key, $val) will produce error with undefined offset as there will not be value for $val.
On Mar 14, 12:13 am, brian <[email protected]> wrote: > This isn't strictly a Cake issue but I wonder if someone has an idea > why I'm seeing the following notice: > > Notice (8): Undefined offset: 1 > [APP/controllers/membership_fees_controller.php, line 107] > > Line 107 is the line below with explode(). This code is parsing > PayPal's PDT response. > > $lines = explode("\n", $res); > $results = array(); > > if (strcmp($lines[0], 'SUCCESS') == 0) > { > array_shift($lines); > foreach($lines as $line) > { > list($key, $val) = explode('=', $line); > $results[urldecode($key)] = urldecode($val); > } > > I can't figure out where a 1 comes into this. AFAICT, though, all of > the results are showing up. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
