$_SERVER['HTTP_USER_AGENT'];
Home »
Ajax
,
Php Interview Questions
,
php-interview-questions-answers
» How can we get the browser properties using PHP?
How can we get the browser properties using PHP?
PMA22:40
Related Posts:
Php get_meta_tags-Extracts all meta tag content attributes get_meta_tags — Extracts all meta tag content attributes from a file and returns an array <?php// Assuming the above tags are at www.example.com$tags = get_meta_tags('htt… Read More
PHP Redirect - Redirect Script? PHP Redirect Function header('Location: destination.php'); exit(); ou need the Location: part so the browser knows what header it's receiving. Also, don't forget to do an exit() or die() right after… Read More
What line should you add to the Apache configuration file to ensure that the .php extension is recognized? This line ensures that Apache will treat files ending with the .php extension asPHP scripts:AddType application/x-httpd-php .php … Read More
how associate multiple elements with a single key? Store the multiple elements in an array: $fruits = array('red' => array('strawberry','apple'), 'yellow' => array('banana')); Or, use an object: while ($obj = mysql_fetch_object($r)) { $fruits[ ] =… Read More
$_ENV and $_SERVER ? PHP sets several variables for you containing information about the server, the environment, and your visitor's request. These are stored in the superglobal arrays $_ENV and $_SERVER, but their availability depends on whe… Read More
What is triggers? A trigger is a database object which is associated with particular database table. Triggers gets called automatically when particular event(INSERT, UPDATE, DELETE) occurs on table. … Read More
What are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()? mysql_fetch_array() -> Fetch a result row as a combination of associative array and regular array. mysql_fetch_object() -> Fetch a result row as an object. mysql_fetch_row() -> Fetch a result set as a regular array… Read More
You want to extract part of a string, starting at a particular place in the string Use substr( ) to select your substrings: $substring = substr($string,$start,$length); $username = substr($_REQUEST['username'],0,8); … Read More
Control Structures if else elseif/else if Alternative syntax for control structures while do-while for foreach break continue switch declare return require include require_ once include_ once goto … Read More
How to prevent hijacking in PHP? Make Error_reporting to E_ALL so that all variables will be intialized before using them. Make practice of using htmlentities(), strip_tags(), utf8_decode() and addslashes() for filtering malicious data in php&nb… Read More
What Is a Session? It is stored at server side because PHP is server side scripting language Session is stored on server side because how much time page will execute it doesn't depend on client it depends on server. Server decide the sess… Read More
How to check whether two floating-point numbers are equal? Use a small delta value, and check if the numbers are equal within that delta: $delta = 0.00001; $a = 1.00000001; $b = 1.00000000; if (abs($a - $b) < $delta) { /* $a and $b are equal */ } … Read More
magic_quotes_gpc, magic_quotes_runtime Magic quotes is the name of a PHP feature that automatically quotes inputdata, by using the addslashes() function. Historically, this was used so thatform data could be used directly in SQL queries without any security or qu… Read More
Web server compression? The best way to understand web server compression is to think of sending ZIP filesinstead of uncompressed files from your web server to your web user. Sending less dataover the network will minimize network latency and your … Read More
access the values passed to a function?how Use the names from the function prototype: function commercial_sponsorship($letter, $number) { print "This episode of Sesame Street is brought to you by "; print "the letter $letter and number $number.\n"; } com… Read More