What is the use of obj_start()?
Its intializing the object buffer, so that the whole page will be first parsed (instead of parsing in parts and thrown to browser gradually) and stored in output buffer so that after complete page is executed, it is thrown to the browser once at a time.
Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example?
In this example it wouldn?t matter, since the variable is all by itself, but if you were to print something like "{$a},000,000 mln dollars", then you definitely need to use the braces.
What is the difference between Split and Explode?
split() can work using regular expressions while explode() cannot.
split and explode divides the string but split can be used in javascript where as explode can be used in php.
How do you capture audio/video in PHP?
FFmpeg is a complete solution to record, convert and stream audio and video. It includes libavcodec, the leading audio/video codec library. FFmpeg is developed under Linux, but it can compiled under most operating systems, including Windows.
How would you initialize your strings with single quotes or double quotes?
Single quote strings are executed faster than double quotes
When we use single quote for string then php will not parse the things between that quote. It simply assign as it is.
But when we use double quotes then it will parse for variables and other things between double quotes.
What is the diffrence between Notify URL and Return URL?
Notify URL is used to just notify the status while processing.
Return URL is used to return after processing .
How to get the URL domain name in PHP?
It is possible by $_server[HTTP_HOST]
eg:
echo $domain;?>
will result the domain name.
How do you create subdomains using PHP?
Create the appropriate web root directory for example /home/sites/username/web and any subdirectories you wish
1. Edit httpd.conf - add a new virtual host section
2. Restart httpd
What is difference between require_once(), require(), include()?
Difference between require() and require_once(): require() includes and evaluates a specific file, while require_once() does that only if it has not been included before (on the same page).
So, require_once() is recommended to use when you want to include a file where you have a lot of functions for example. This way you make sure you don't include the file more times and you will not get the "function re-declared" error.
Difference between require() and include() is that require() produces a FATAL ERROR if the file you want to include is not found, while include() only produces a WARNING.
There is also include_once() which is the same as include(), but the difference between them is the same as the difference between require() and require_once().
There is also include_once() which is the same as include(), but the difference between them is the same as the difference between require() and require_once().
Where does the PHP session stored, either client side or server side?
It is stored at server side because PHP is server side scripting language
It is stored at the server side but a cookie is stored at the client side that contains the session information. Every request sent by the client to the server has that particular cookie with it.
Where does the PHP session stored, either client side or server side?
It is stored at server side because PHP is server side scripting language
It is stored at the server side but a cookie is stored at the client side that contains the session information. Every request sent by the client to the server has that particular cookie with it.
How do we know browser properties?
get_browser() attempts to determine the capabilities of the user's browser. This is done by looking up the browser's information in the browscap.ini file.
echo $_SERVER['HTTP_USER_AGENT'] . "
";
$browser = get_browser();
foreach ($browser as $name => $value)
{
echo "$name $value
";
}
How to prevent form hijacking in PHP?
Following things can be done for preventing your PHP Form from Hijacking
1. Make register_globals to off to prevent Form Injection with malicious data.
2. Make Error_reporting to E_ALL so that all variables will be intialized before using them.
3. Make practice of using htmlentities(), strip_tags(), utf8_decode() and addslashes() for filtering malicious data in php
4. Make practice of using mysql_escape_string() in mysql.
What Is a Persistent Cookie?
A persistent cookie is a cookie which is stored in a cookie file permanently on the browser's computer. By default, cookies are created as temporary cookies which stored only in the browser's memory. When the browser is closed, temporary cookies will be erased. You should decide when to use temporary cookies and when to use persistent cookies based on their differences:
Temporary cookies can not be used for tracking long-term information.
Persistent cookies can be used for tracking long-term information.
Temporary cookies are safer because no programs other than the browser can access them.
Persistent cookies are less secure because users can open cookie files see the cookie values.
Friday, June 3, 2011
Subscribe to:
Posts (Atom)