What is PHP?
PHP is a widely-used server side scripting language that is especially suited for web development, creating dynamic websites and can be embedded into HTML.
What does PHP stand for?
PHP stands for Hypertext Preprocessor.
What is PEAR?
PEAR stands for PHP Extension and Application Repository and is widely used to provide a high level of programming for web programmers.
What is the purpose of constant() function?
As indicated by the name, this function will return the value of the constant. This is useful when you want to retrieve value of a constant, but you do not know its name, i.e. It is stored in a variable or returned by a function.
What is the process to run the smart PHP shell from the command line interface?
Basically use the PHP CLI program with the option like:
Php - a
What are the privilege and the most two essential ways to initiate and execute a PHP bit of code?
The two most consistent ways to start and finish a PHP script are: <? Php [— PHP code— -]?> and <? [—PHP code — ]?>
How can we demonstrate the output to the program?
To demonstrate the output to the program, use special tags <? = and?>.
Is various heritages maintained in PHP?
PHP support single inheritance, it suggests that a class can be extended from only a child class using the catchphrase 'created'.
What is the difference between a final class and a final method?
Final is introduced in PHP5. Final class means that this class cannot be sub classed and a final method cannot be overridden.
What type of operation is needed when passing values through a form or an URL?
If we would like to pass values through a form or an URL then we need to encode and to decode them using htmlspecialchars() and urlencode().
How can I display text with a PHP script?
Two methods are possible:
<!--? Php echo "Method 1"; print "Method 2";?-->
How can PHP and JavaScript interact?
PHP and JavaScript cannot directly interact since PHP is a server side language and Javascript is a client side language. However we can exchange variables since PHP is able to generate Javascript code to be executed by the browser and it is possible to pass specific variables back to PHP via the URL.
What is needed to be able to use image function?
GD library is needed to be able execute image functions.
What is the use of the function ‘imagetypes()’?
imagetypes() gives the image format and types supported by the current version of GD-PHP.
Interested in Learning PHP with Advanced Frameworks? Click Here
How comparison of objects is done in PHP5?
We use the operator ‘==’ to test is two object are instanced from the same class and have same attributes and equal values. We can test if two object are referring to the same instance of the same class by the use of the identity operator ‘===’.
How can PHP and HTML interact?
It is possible to generate HTML through PHP scripts, and it is possible to pass information from HTML to PHP.
What is the main difference between require() and require_once()?
require() and require_once () perform the same task except that the second function checks if the PHP script is already included or not before executing it.
(Same for include_once() and include()
What are the functions to be used to get the image’s properties (size, width and height)?
The functions are getimagesize() for size, imagesx() for width and imagesy() for height.
How is it possible to set an infinite execution time for PHP script?
The set_time_limit(0) added at the beginning of a script sets to infinite the time of execution to not have the PHP error ‘maximum execution time exceeded’. It is also possible to specify this in the php.ini file.
How failures in execution are handled with include() and require() functions?
If the function require() cannot access to the file then it ends with a fatal error. However, the include() function gives a warning and the PHP script continues to execute.
How can we display information of a variable and readable by human with PHP?
To be able to display a human-readable result we use print_r().
What does the PHP error ‘Parse error in PHP – unexpected T_variable at line x’ means?
This is a PHP syntax error expressing that a mistake at the line x stops parsing and executing the program.
Define smarty?
Smarty is a template engine written in PHP. Normally, these templates will include variables —like {$variable} — and a range of logical and loop operators to enable adaptability within of the template.
What is Memcache?
Memcache is a technique that caches objects in memory such that your web application can get to them really fast. It is used by sites such as Digg.com, Facebook.com and NowPublic.com and is widely recognized as an essential ingredient in scaling any LAMP.
How can we execute a PHP script using command line?
Just run the PHP CLI (Command Line Interface) program and provide the PHP script file name as the command line argument. For example, “php myScript.php”, assuming “php” is the command to invoke the CLI program.
Get PHP Certification in just 20 Hours, Contact Now
What is the purpose of _CLASS_ constant?
_CLASS_ − The class name. (Added in PHP 4.3.0) As of PHP 5 this constant returns the class name as it was declared (case-sensitive).
How will you find the length of a string in PHP?
The strlen() function is used to find the length of a string.
How will you get environment variables in PHP?
PHP provides a function getenv() to access the value of all the environment variables.
What is the purpse $_REQUEST variable?
The PHP $_REQUEST variable contains the contents of $_GET, $_POST, and $_COOKIE. The PHP $_REQUEST variable can be used to get the result form data sent with both the GET and POST methods.
Can you assign the default values to a function parameters?
Yes, we can set a parameter to have a default value if the function's caller does not pass it.
Save
Save
Save
Save
Prev
Next