CodeIgniter Forums
Difference between $this->agent->agent_string and $this->input->user_agent() - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Difference between $this->agent->agent_string and $this->input->user_agent() (/showthread.php?tid=39168)



Difference between $this->agent->agent_string and $this->input->user_agent() - El Forum - 03-03-2011

[eluser]Chalda Pnuzig[/eluser]
What is the difference?


Difference between $this->agent->agent_string and $this->input->user_agent() - El Forum - 03-03-2011

[eluser]InsiteFX[/eluser]
Code:
$this->agent->agent_string()

// Returns a string containing the full user agent string. Typically it will be something like this:
// Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.0.4) Gecko/20060613 Camino/1.0.2

$this->input->user_agent()

// Returns the user agent (web browser) being used by the current user. Returns FALSE if it's not available.
echo $this->input->user_agent();

InsiteFX


Difference between $this->agent->agent_string and $this->input->user_agent() - El Forum - 03-03-2011

[eluser]Chalda Pnuzig[/eluser]
Ok, I found it:
Code:
$this->agent->agent_string()  // returns NULL if it's not available

$this->input->user_agent()  // returns FALSE if it's not available