title: Getting the error Undefined index: wp-login in my script?
body: <p>This is the exact error:</p>
  
  <pre><code>Undefined index: wp-login in /home/the/path/file.php on line 159
  Undefined index: wp-login in /home/the/path/file.php on line 161
  Undefined index: wp-login in /home/the/path/file.php on line 162
  </code></pre>
  
  <p>Sometimes, I get <code>robots</code>, <code>title-tag</code> etc. instead of <code>wp-login</code>:</p>
  
  <pre><code>Undefined index: robots in /home/the/path/file.php on line 159
  Undefined index: title-tag in /home/the/path/file.php on line 159
  ... and so on.
  </code></pre>
  
  <p>I am not using any WordPress plugin or anything else related to WordPress. Also, I am <strong>not</strong> accessing any array elements using <code>robots</code>, <code>title-tag</code> or <code>wp-login</code> as keys in the whole script.</p>
  
  <p>Could anyone please tell me why do my error_log keeps filling with these errors?</p>
  
  <p>This is the PHP code on line 159, 161 and 162:</p>
  
  <pre><code>$topics[substr($url_parts[3],0,-4)]
  </code></pre>
  
  <p>and this is the <code>$topics</code> array:</p>
  
  <pre><code>$topics  = ['technology'=&gt;'Technology','android'=&gt;'Android News','apple'=&gt;'Apple News'];
  </code></pre>