Welcome Guest, Not a member yet? Register   Sign In
Having trouble with a foreach loop
#3

Just use var_dump($keywords) to find out what exactly the content is (and type of data) of that variable.

You say it suppose to be an array, so have you tried:
PHP Code:
foreach ($keywords as $key => $keyword) {
 
  ...


That being said, you do know that CodeIgniter has some useragent detection build in?

PHP Code:
$this->load->library('user_agent');

if (
$this->agent->is_robot()) {
 
   ...


https://www.codeigniter.com/userguide3/l...agent.html
Reply


Messages In This Thread
Having trouble with a foreach loop - by doomie22 - 09-15-2016, 06:05 AM
RE: Having trouble with a foreach loop - by Diederik - 09-15-2016, 06:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB