A PHP variable is the name of the memory location that holds data. It is temporary storage. Syntax: $variableName=value;
PHP Interview Questions
The indexed array holds elements in an indexed form which is represented by number starting from 0 and incremented by 1. For example: $season=array(“summer”,”winter”,”spring”,”autumn”); The associative array holds elements with name. For example: $salary=array(“Sonoo”=>”350000″,”John”=>”450000″,”Kartik”=>”200000”);
PHP fwrite() and fputs() functions are used to write data into file. To write data into a file, you need to use w, r+, w+, x, x+, c or c+ mode.
$message stores variable data while $$message is used to store variable of variables. $message stores fixed data whereas the data stored in $$message may be changed dynamically.
The strlen() function is used to get the length of the string.
The unlink() function is used to delete a file in PHP. bool unlink (string $filename)
A persistent cookie is permanently stored in a cookie file on the browser’s computer. By default, cookies are temporary and are erased if we close the browser.
PHP stands for Hypertext Preprocessor. It is an open source server-side scripting language which is widely used for web development. It supports many databases like MySQL, Oracle, Sybase, Solid, PostgreSQL, generic ODBC etc.
PHP constants are name or identifier that can’t be changed during execution of the script. PHP constants are defined in two ways: Using define() function Using const() function