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

(09-15-2016, 06:25 AM)Diederik Wrote: 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

Thank you so much for this.

One small question about it, I am trying to figure out the parse section in user_agent.  I am seeing that sites are able to get resolutions and device names (if they are mobile) can you use parse to get this sort of info and if so, how?

Thanks,
Doomie
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 doomie22 - 09-15-2016, 03:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB