Rasmus Lerdorf is known as the father of PHP.
2 MB is the default maximum file size to upload.
We can increase the uploading limit of a file in following ways:
- By making changes in php.ini
upload_max_filesize=40M // this will limit the uploading size upto 40M
- By overriding the php ini function in your php file.
- By placing script in .htaccess file of server.
php_value upload_max_filesize 40M
php_value post_max_size 42M
$foo is variable where as
$$foo is reference variable. For example
$Lorem value is Ipsum.
submit() function can be used to submit a form without using submit button. You can use this function in
onClick() event on a button click.
<form name="form1" action="result.php" method="POST">
<input type="text" name="name" value="Enter Name">
mysql_fetch_object() are used to fetch data from a MySql table, difference is one return object and one return array. Simply means with
mysql_fetch_object() you can access the data by the field names and with
mysql_fetch_array() you can access data by their offsets.
$data = mysql_fetch_object($data); $Result->name; $Result = mysql_fetch_array($data); $Result['name'];
require() used to include a file from server but difference is when a included or required file not found on server
include() sends Warning where as
require() sends Fatal Error.
Yes, we can include the same file i.e
include("abc.php") two times in a php file, But this may generate error if the file contains some class declaration or function/method declaration, otherwise you can include same file as many times as per the requirement.
A cookie can store data up to the size of 4096 bytes i.e is 4Kb, the limit of cookie per domain is 20 cookies.
You can use the PHP
array_unique() function, which will return the unique values from an array containing duplicate data.
$data = array('A','B','C','D','A','D','D','E','F','Z'); $Result = array_unique($data); print_r($Result); /***OUTPUT***/ array('A','B','C','D','E','F','Z')