0

I need to switch on E_ALL and get the in the title mentioned warning, when I am exploding the $_GET string:

$input = explode( '/', $_GET['string'] ); 

Where does that come from? Is it the missing 3rd parameter (limit) for explode ? I want all entries.

Cheers

user2942586
  • 333
  • 1
  • 2
  • 12

1 Answers1

4

You need to make use of the isset construct first.

<?php
if (isset($_GET['string'])) {
    $input = explode('/', $_GET['string']);
} else {
    echo "The string was not passed!";
}
Shankar Narayana Damodaran
  • 68,075
  • 43
  • 96
  • 126