Which cryptographic extension provide generation and verification of digital signatures?
The PHP-OpenSSL extension provides several cryptographic operations including generation and verification of digital signatures.
How is a constant defined in a PHP script?
The define() directive lets us defining a constant as follows:
define ("ACONSTANT", 123);
How can you pass a variable by reference?
To be able to pass a variable by reference, we use an ampersand in front of it, as follows $var1 = &$var2
Will a comparison of an integer 12 and a string "13" work in PHP?
"13" and 12 can be compared in PHP since it casts everything to the integer type.
If the variable $var1 is set to 10 and the $var2 is set to the character var1, what's the value of $$var2?
$$var2 contains the value 10.
What does accessing a class via :: means?
:: is used to access static methods that do not require object initialization.
In PHP, objects are they passed by value or by reference?
In PHP, objects passed by value.
Are Parent constructors called implicitly inside a class constructor?
No, a parent constructor have to be called explicitly as follows:
parent::constructor($value)
What Is Meant By Urlencode And Urldecode?
urlencode() returns the URL encoded version of the given string. URL coding converts special characters into % signs followed by two hex digits. For example: urlencode("10.00%") will return "10%2E00%25". URL encoded strings are safe to be used as part of URLs.
urldecode() returns the URL decoded version of the given string.
How To Get The Uploaded File Information In The Receiving Script?
Once the Web server received the uploaded file, it will call the PHP script specified in the form action attribute to process them. This receiving PHP script can get the uploaded file information through the predefined array called $_FILES. Uploaded file information is organized in $_FILES as a two-dimensional array as:
$_FILES[$fieldName]['name'] - The Original file name on the browser system.
$_FILES[$fieldName]['type'] - The file type determined by the browser.
$_FILES[$fieldName]['size'] - The Number of bytes of the file content.
$_FILES[$fieldName]['tmp_name'] - The temporary filename of the file in which
the uploaded file was stored on the server.
$_FILES[$fieldName]['error'] - The error code associated with this file upload.
The $fieldName is the name used in the.
What Is A Session?
A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests.
There is only one session object available to your PHP scripts at any time. Data saved to the session by a script can be retrieved by the same script or another script when requested from the same visitor.
Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visitor.
What Is Meant By Pear In Php?
PEAR is the next revolution in PHP. This repository is bringing higher level programming to PHP. PEAR is a framework and distribution system for reusable PHP components. It eases installation by bringing an automated wizard, and packing the strength and experience of PHP users into a nicely organised OOP library. PEAR also provides a command-line interface that can be used to automatically install "packages".
What Is The Difference Between Mysql_fetch_object And Mysql_fetch_array?
MySQL fetch object will collect first single matching record where mysql_fetch_array will collect all matching records from the table in an array.
How Can I 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.
Be aware that if your PHP script was written for the Web CGI interface, it may not execute properly in command line environment.
I Am Trying To Assign A Variable The Value Of 0123, But It Keeps Coming Up With A Different Number, What's The Problem?
PHP Interpreter treats numbers beginning with 0 as octal. Look at the similar PHP interview questions for more numeric problems.
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 Are The Different Tables Present In Mysql? Which Type Of Table Is Generated When We Are Creating A Table In The Following Syntax: Create Table Employee(eno Int(2),ename Varchar(10))?
Total 5 types of tables we can create
1. MyISAM
2. Heap
3. Merge
4. INNO DB
5. ISAM
MyISAM is the default storage engine as of MySQL 3.23. When you fire the above
create query MySQL will create a MyISAM table.
How To Create A Table?
If you want to create a table, you can run the CREATE TABLE statement as shown in the following sample script:
<?php
include "mysql_connection.php";
$sql = "CREATE TABLE fyi_links ("
. " id INTEGER NOT NULL"
. ", url VARCHAR(80) NOT NULL"
. ", notes VARCHAR(1024)"
. ", counts INTEGER"
. ", time TIMESTAMP DEFAULT sysdate()"
. ")";
if (mysql_query($sql, $con)) {
print("Table fyi_links created.n");
} else {
print("Table creation failed.n");
}
mysql_close($con);
?>
Remember that mysql_query() returns TRUE/FALSE on CREATE statements. If you run this script, you will get something like this:
Table fyi_links created.
What Are The Differences Between Get And Post Methods In Form Submitting, Give The Case Where We Can Use Get And We Can Use Post Methods?
When you want to send short or small data, not containing ASCII characters, then you can use GET” Method. But for long data sending, say more then 100 character you can use POST method.
Once most important difference is when you are sending the form with GET method. You can see the output which you are sending in the address bar. Whereas if you send the form with POST” method then user can not see that information.
How Do You Call A Constructor For A Parent Class?
parent::constructor($value).
What Are The Different Types Of Errors In Php?
Here are three basic types of runtime errors in PHP:
Notices: These are trivial, non-critical errors that PHP encounters while executing a script - for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all - although you can change this default behavior.
Warnings: These are more serious errors - for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.
Fatal errors: These are critical errors - for example, instantiating an object of a nonexistent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP's default behavior is to display them to the user when they take place.
Internally, these variations are represented by twelve different error types.
What's The Special Meaning Of __sleep And __wakeup?
__sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them.
How Can We Submit A Form Without A Submit Button?
If you don't want to use the Submit button to submit a form, you can use normal hyper links to submit a form. But you need to use some JavaScript code in the URL of the link. For example:
<a href="javascript: document.myform.submit();">Submit Me</a>.
Would You Initialize Your Strings With Single Quotes Or Double Quotes?
Since the data inside the single-quoted string is not parsed for variable substitution, it’s always a better idea speed-wise to initialize a string with single quotes, unless you specifically need variable substitution.
What Is The Difference Between The Functions Unlink And Unset?
unlink() is a function for file system handling. It will simply delete the file in context.
unset() is a function for variable management. It will make a variable undefined.
How Come The Code Works, But Doesn't For Two-dimensional Array Of Mine?
Any time you have an array with more than one dimension, complex parsing syntax is required. print "Contents: {$arr[1][2]}" would’ve worked.
How Can We Register The Variables Into A Session?
session_register($session_var);
$_SESSION['var'] = 'value';
The PHP-OpenSSL extension provides several cryptographic operations including generation and verification of digital signatures.
How is a constant defined in a PHP script?
The define() directive lets us defining a constant as follows:
define ("ACONSTANT", 123);
How can you pass a variable by reference?
To be able to pass a variable by reference, we use an ampersand in front of it, as follows $var1 = &$var2
Will a comparison of an integer 12 and a string "13" work in PHP?
"13" and 12 can be compared in PHP since it casts everything to the integer type.
Wirecard PHP Most Frequently Asked Latest Interview Questions Answers |
If the variable $var1 is set to 10 and the $var2 is set to the character var1, what's the value of $$var2?
$$var2 contains the value 10.
What does accessing a class via :: means?
:: is used to access static methods that do not require object initialization.
In PHP, objects are they passed by value or by reference?
In PHP, objects passed by value.
Are Parent constructors called implicitly inside a class constructor?
No, a parent constructor have to be called explicitly as follows:
parent::constructor($value)
What Is Meant By Urlencode And Urldecode?
urlencode() returns the URL encoded version of the given string. URL coding converts special characters into % signs followed by two hex digits. For example: urlencode("10.00%") will return "10%2E00%25". URL encoded strings are safe to be used as part of URLs.
urldecode() returns the URL decoded version of the given string.
How To Get The Uploaded File Information In The Receiving Script?
Once the Web server received the uploaded file, it will call the PHP script specified in the form action attribute to process them. This receiving PHP script can get the uploaded file information through the predefined array called $_FILES. Uploaded file information is organized in $_FILES as a two-dimensional array as:
$_FILES[$fieldName]['name'] - The Original file name on the browser system.
$_FILES[$fieldName]['type'] - The file type determined by the browser.
$_FILES[$fieldName]['size'] - The Number of bytes of the file content.
$_FILES[$fieldName]['tmp_name'] - The temporary filename of the file in which
the uploaded file was stored on the server.
$_FILES[$fieldName]['error'] - The error code associated with this file upload.
The $fieldName is the name used in the.
What Is A Session?
A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests.
There is only one session object available to your PHP scripts at any time. Data saved to the session by a script can be retrieved by the same script or another script when requested from the same visitor.
Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visitor.
What Is Meant By Pear In Php?
PEAR is the next revolution in PHP. This repository is bringing higher level programming to PHP. PEAR is a framework and distribution system for reusable PHP components. It eases installation by bringing an automated wizard, and packing the strength and experience of PHP users into a nicely organised OOP library. PEAR also provides a command-line interface that can be used to automatically install "packages".
What Is The Difference Between Mysql_fetch_object And Mysql_fetch_array?
MySQL fetch object will collect first single matching record where mysql_fetch_array will collect all matching records from the table in an array.
How Can I 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.
Be aware that if your PHP script was written for the Web CGI interface, it may not execute properly in command line environment.
I Am Trying To Assign A Variable The Value Of 0123, But It Keeps Coming Up With A Different Number, What's The Problem?
PHP Interpreter treats numbers beginning with 0 as octal. Look at the similar PHP interview questions for more numeric problems.
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 Are The Different Tables Present In Mysql? Which Type Of Table Is Generated When We Are Creating A Table In The Following Syntax: Create Table Employee(eno Int(2),ename Varchar(10))?
Total 5 types of tables we can create
1. MyISAM
2. Heap
3. Merge
4. INNO DB
5. ISAM
MyISAM is the default storage engine as of MySQL 3.23. When you fire the above
create query MySQL will create a MyISAM table.
How To Create A Table?
If you want to create a table, you can run the CREATE TABLE statement as shown in the following sample script:
<?php
include "mysql_connection.php";
$sql = "CREATE TABLE fyi_links ("
. " id INTEGER NOT NULL"
. ", url VARCHAR(80) NOT NULL"
. ", notes VARCHAR(1024)"
. ", counts INTEGER"
. ", time TIMESTAMP DEFAULT sysdate()"
. ")";
if (mysql_query($sql, $con)) {
print("Table fyi_links created.n");
} else {
print("Table creation failed.n");
}
mysql_close($con);
?>
Remember that mysql_query() returns TRUE/FALSE on CREATE statements. If you run this script, you will get something like this:
Table fyi_links created.
What Are The Differences Between Get And Post Methods In Form Submitting, Give The Case Where We Can Use Get And We Can Use Post Methods?
When you want to send short or small data, not containing ASCII characters, then you can use GET” Method. But for long data sending, say more then 100 character you can use POST method.
Once most important difference is when you are sending the form with GET method. You can see the output which you are sending in the address bar. Whereas if you send the form with POST” method then user can not see that information.
How Do You Call A Constructor For A Parent Class?
parent::constructor($value).
What Are The Different Types Of Errors In Php?
Here are three basic types of runtime errors in PHP:
Notices: These are trivial, non-critical errors that PHP encounters while executing a script - for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all - although you can change this default behavior.
Warnings: These are more serious errors - for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.
Fatal errors: These are critical errors - for example, instantiating an object of a nonexistent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP's default behavior is to display them to the user when they take place.
Internally, these variations are represented by twelve different error types.
What's The Special Meaning Of __sleep And __wakeup?
__sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them.
How Can We Submit A Form Without A Submit Button?
If you don't want to use the Submit button to submit a form, you can use normal hyper links to submit a form. But you need to use some JavaScript code in the URL of the link. For example:
<a href="javascript: document.myform.submit();">Submit Me</a>.
Would You Initialize Your Strings With Single Quotes Or Double Quotes?
Since the data inside the single-quoted string is not parsed for variable substitution, it’s always a better idea speed-wise to initialize a string with single quotes, unless you specifically need variable substitution.
What Is The Difference Between The Functions Unlink And Unset?
unlink() is a function for file system handling. It will simply delete the file in context.
unset() is a function for variable management. It will make a variable undefined.
How Come The Code Works, But Doesn't For Two-dimensional Array Of Mine?
Any time you have an array with more than one dimension, complex parsing syntax is required. print "Contents: {$arr[1][2]}" would’ve worked.
How Can We Register The Variables Into A Session?
session_register($session_var);
$_SESSION['var'] = 'value';
Post a Comment