preload

The “Final” keyword is used to make the class uninheritable. So the class or it’s methods can not be overridden.


An Abstract class will never be a final class as an abstract class must be extendable.

Read More...

Magic methods are the members functions that is available to all the instance of class Magic methods always starts with "__".

Eg. __construct. All magic methods needs to be declared as public To use magic method they should be defined within the class or program scope Various Magic Methods used in PHP 5 are:
__construct() __destruct() __set() __get() __call() __toString() __sleep() __wakeup() __isset() __unset() __autoload() __clone()

Read More...

default session time in PHP is 1440 seconds or 24 minutes
Default session save path id temporary folder /tmp

Read More...

There are lot of difference among these three version of php
1)Php3 is oldest version after that php4 came and current version is php5 (php5.3) where php6 have to come
2)Difference mean oldest version have less functionality as compare to new one like php5 have all OOPs concept now where as php3 was pure procedural language constructive like C
In PHP5
1. Implementation of exceptions and exception handling
2. Type hinting which allows you to force the type of a specific argument
3. Overloading of methods through the __call function
4. Full constructors and destructors etc through a __constuctor and __destructor function
5. __autoload function for dynamically including certain include files depending on the class you are trying to create.
6 Finality : can now use the final keyword to indicate that a method cannot be overridden by a child. You can also declare an entire class as final which prevents it from having any children at all.
7 Interfaces & Abstract Classes
8 Passed by Reference :
9 An __clone method if you really want to duplicate an object

Read More...

The header() function sends a raw HTTP header to a client.We can use header()
function for redirection of pages. It is important to notice that header() must
be called before any actual output is seen..

Read More...

Following tables (Storage Engine) we can create
1. MyISAM(The default storage engine IN MYSQL Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type. An .frm file stores the table format. The data file has an .MYD (MYData) extension. The index file has an .MYI (MYIndex) extension. )
2. InnoDB(InnoDB is a transaction-safe (ACID compliant) storage engine for MySQL that has commit, rollback, and crash-recovery capabilities to protect user data.)
3. Merge
4. Heap (MEMORY)(The MEMORY storage engine creates tables with contents that are stored in memory. Formerly, these were known as HEAP tables. MEMORY is the preferred term, although HEAP remains supported for backward compatibility. )
5. BDB (BerkeleyDB)(Sleepycat Software has provided MySQL with the Berkeley DB transactional storage engine. This storage engine typically is called BDB for short. BDB tables may have a greater chance of surviving crashes and are also capable of COMMIT and ROLLBACK operations on transactions)
6. EXAMPLE
7. FEDERATED (It is a storage engine that accesses data in tables of remote databases rather than in local tables. )
8. ARCHIVE (The ARCHIVE storage engine is used for storing large amounts of data without indexes in a very small footprint. )
9. CSV (The CSV storage engine stores data in text files using comma-separated values format.)
10. BLACKHOLE (The BLACKHOLE storage engine acts as a "black hole" that accepts data but throws it away and does not store it. Retrievals always return an empty result)

Read More...

$name is variable where as $$name is reference variable
like $name=sonia and $$name=singh so $sonia value is singh.

Read More...

We can do it by 4 Ways
1. mysql_fetch_row
2. mysql_fetch_array
3. mysql_fetch_object
4. mysql_fetch_assoc

Read More...

There are some defference between GET and POST method
1. GET Method have some limit like only 2Kb data able to send for request. But in POST method unlimited data can we send
2. when we use GET method requested data show in url but Not in POST method so POST method is good for send sensitive request.

Read More...

preg_match("/^http:\/\/.+@(.+)$/","http://info@pcds.co.in",$matches);
echo $matches[1];

Read More...

Inserts HTML line breaks (<BR />) before all newlines in a string.

Read More...

.htaccess is often the only file we have access to. It lives at the root of a Web site - in the same directory as the default home page of a site - and/or below that in the subdirectories for the site. Therefore, the Webmaster can upload, modify, copy, or move it at will.

However, if you administrate your own server, then you'll also have access to httpd.conf, which is one of the server configuration files. It is located along with the rest of the server files at a level that users can't get to.

Directives in httpd.conf are compiled at server start-up, so that processing is more efficient. Directives in .htaccess, however, must be interpreted for each and every HTTP request; Interpreting them slows things down a bit, and might be done 20 times to load a single HTML page with several images and scripts on it.

However, interpreting .htaccess directives is no less efficient than interpreting any other scripted language, so you do the same thing you'd do with any script that was to be run often: Decide exactly what you need to do and code it as efficiently as possible.

On the other hand, changing a directive in .htaccess does not require the server to be restarted, so some may wish to test their code by running it in .htaccess, and then 'port' it to httpd.conf once it is initially debugged. That option -- when available -- gives the best of both worlds.

Read More...

Rasmus Lerdorf is known as the father of PHP.

Read More...

 Three are three types of errors:
1. 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, as you will see, you can change this default behavior.
2. 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.
3. Fatal errors: These are critical errors  for example, instantiating an object of a non-existent 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.

Read More...

PHP allows to change some settings mentioned in php.ini for the current script via ini_set(). This function requires two string arguments. First one is the setting name and the second one is the value. 

For an example think that your script is in a remote server and it has disabled display_errors setting. If you are still developing your application and would like to see errors in web browser then you can enable this setting as below.

ini_set('display_errors', '1');
You may put above statement at the top of your script so that the setting will be enabled till the end of the script.
Values you set via ini_set() are applicable only to current script. Thereafter PHP would continue to use original values from php.ini

To avoid doubts, before changing a setting via ini_set(), you would need to identify whether PHP allows to change the particular setting via ini_set(). In PHP manual, it lists all the available settings in php.ini. In this list there is a column called Changeable. According to definitions of the values in this column, you can only change the settings mentioned as PHP_INI_USER or PHP_INI_ALL.

ini_get()

This function accepts a setting name as the argument and returns its current value. If you placed this function after ini_set(), you would notice that it returns the newly assigned value (not the original php.ini value).

get_cfg_var()

This function is similar to ini_get(). Difference is it returns the original value in php.ini even after an ini_set(). To illustrate this, make sure you have enabled display_errors in your php.ini and run following script.
01.<?php
02. 
03.ini_set('display_errors', '0');
04. 
05.echo ini_get('display_errors');
06.echo '<br />';
07.echo get_cfg_var('display_errors');
08. 
09.?>
You would see the output as below.
0
1

error_reporting()

This function instructs the PHP interpreter on which type of errors should be reported for current script. 
For an example, to make sure all the errors are reported for current script, you can call this function at the top of your script as below.
error_reporting(E_ALL);

Following statement would turn off all error reporting for the current script.
error_reporting(0);
And following will enable all error reporting for the current script.
error_reporting(-1);
error_reporting() is a special function to change the error_reporting setting. It’s also possible to do the changes via ini_set(). For an example, following would enable reporting of all errors in current script (similar to error_reporting(E_ALL)).
ini_set('error_reporting', E_ALL);

Read More...

PHP.ini is very useful and it is a configuration file that is used to customize behavior of PHP at runtime. This enables easy administration in the way you administer Apache web server using configuration files. The Settings in which upload directory, register global variables, display errors, log errors, max uploading size setting, maximum time to execute a script and other configurations is written in this file.

When PHP Server starts up it looks for PHP.ini file first to load various values for settings. If you made changes in PHP.ini then you need to restart your server to check the changes be effected. Default php.ini file of web server.the copy of this ini file can be found in /usr/local/lib/php/ for UNIX installation.

If you want to do some custom configurations then you can also write your own php.ini file. For this copy php.ini template file, make necessary changes in values directives according to your need rename it to php.ini then copy it to desired location in root of your web directory or in any particular folder. But hosting should allow for running this file. The PHP runtime will take values only for settings which are specified in php.ini file if you are using your own, for rest of settings it will take defaults of PHP runtime. So if you are writing your own php.ini, keep in mind to overwrite every settings specified in web server’s php.ini file this cannot be used as an extension of web server’s php.ini file

Read More...

PHP Stands for Hypertext PreProcessor

PHP is a server-side, cross-platform, HTML embedded scripting language.

That's a mouthful, but if we break the definition down into smaller pieces, it is easier to understand.

server-side: This means that PHP scripts execute on the Web server, not within the browser on your local machine.

cross-platform: Cross-platform means that PHP scripts can run on many different operating systems and Web servers. PHP is available for the two most popular Web server configurations (IIS running on Windows NT and Apache running on UNIX).

HTML embedded scripting language: This means that PHP statements and commands are actually embedded in your HTML documents. When the Web server sees the PHP statements in the Web page, the server executes the statements and sends the resulting output along with the rest of the HTML. PHP commands are parsed by the server much like Active Server Pages or Cold Fusion tags.

Read More...

Contact Us

Gmail
nmohanswe
Facebook
nmohanswe
Twitter
nmohanswe
Skype
nmohanswe