Objects in php oops

PHP is capable of functioning as an object-oriented programming language (or OOP). As such, it must be able to handle objects. An object is a data type that allows for the storage of not only data but also information on how to process that data. The data elements stored within an object are referred to as its properties, also sometimes called the attributes of the object. The information, or code, describing how to process the data compromises what are called the methods of the object.
Objects have two components to their construction. First, you must declare a class of object. It defines the structure of the object to be constructed. Then you instantiate the object, which means you declare a variable to be of a certain class and assign values to it appropriately.
Another way of looking at objects is that they allow you to create your own data types. You define the data type in the object class, and then you use the data type in instances of that class.
Yes, there is also an is_object() function to test whether a variable is on object instance.

find out the number of parameters passed into function

func_num_args() function returns the number of parameters passed in.

Defining a constant variable in php

Using define() directive, like define ("MYNAME", "Ajay Sharavat"); and to use constant varibale just
type echo MYNAME; or constant("MYNAME");

Difference between include and require

In case of include if the file doesn't exist it will give a warning but the rest of code will execute. But if we are using require then it will through a fatal error and will not execute the code.

Difference between mysql_connect and mysql_pconnect

mysql_connect is a normal mysql connection which opens and closes on each page. While mysql_pconnect is a persistant connection which will be open once and remained open throught the session.
mysql_pconnect does't work on high traffic because we have a limited number of mysql connections.
So using mysql_connect is good to use.

Difference between ereg_replace() and eregi_replace()

ereg_replace() is case sensitive while eregi_replace() is not. For example 'ajay' and 'AjAy' are different for ereg_replace() but same for eregi_replace().

Linux name resolution: /etc/resolv.conf

Name resolution means translating a string such as 'gateway.enterprise.net' into an IP address such as 194.72.194.1. When your machine is connected to the Internet, you need to be able to do this for addresses all over the world.
You do this through the Internet's Domain Name Service, which is a decentralised system for address translation. You will not usually run a nameserver yourself, unless you are managing extensive sub-networks. The nameserver is run by your ISP.

You have to tell your software where to find the name servers. This is done in /etc/resolv.conf, which looks like this:

domain lfix.co.uk
nameserver 194.72.192.1
nameserver 194.72.192.3
The domain is your own domain name, corresponding to the suffixes in /etc/hosts.
The nameservers are the primary and secondary nameservers of my ISP, Enterprise plc. The IP addresses are specified, rather than the names, because you would need a nameserver to translate the names to IP addresses.

If you try to use an address which is not in your local domain, the name resolver will ask the primary nameserver for its IP address. If that fails, it will try the secondary nameserver before giving up.

If PPP is not running, you will get the message "No route to host", meaning that there is no way to contact the nameserver.