Hi, I am total newbie. my php code has the following lines to show links related to a current line. Each line has 2 or more (urls) from the database.
After adding more links to the DB, I added the last line of “$urls[3]”, but now when there is only to urls, it gives the error:
Unknown error type: [8] Undefined offset: 3
How can I add if, else - or something to these lines to show whatever available (2-3-4… etc.), without giving the error
$urls = explode("</br>", list($book, $chapter, $connection));
$urls[0] = str_replace("</a>", "<br>($book_abb)</a>", $urls[0]);
$urls[1] = str_replace("</a>", "<br>($book_abb)</a>", $urls[1]);
$urls[2] = str_replace("</a>", "<br>($book_abb)</a>", $urls[2]);
$urls[3] = str_replace("</a>", "<br>($book_abb)</a>", $urls[3]);
echo implode("<br/>", $urls);
Thanks,