PHP Interview Questions -10

PHP Interview Questions -10
 

1. What is PHP stands for?

Hyper text Pre Processor

2. What is PHP?

The PHP is a Hypertext Pre-processor and is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications.

3. Who is the Father of PHP?

Rasmus Lerdorf

4. Which programming language does PHP resemble to?

PHP resemble to pearl and C

5. What the difference is between include and require?

Require () and include () are the same with respect to handling failures. However, require () results in a fatal error and does not allow the processing of the page. i.e. include will allow the script to continue.

6. What is the current version of PHP?

php 5.3

7. How can we create a database using PHP and MySQL?

We can create MySQL database with the use of mysql_create_db ("Database Name")

8.What Is a Session?

It can be used to store information on the server for future use.

9. Is variable name case sensitive?

Yes variable name case sensitive and we cannot start a variable with number like $6name as a valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.

10. How can we 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.

11.How can I know that a variable is a number or not using a JavaScript?

bool is_numeric ( mixed var) Returns TRUE if var is a number or a numeric string, FALSE otherwise.or use isNaN(mixed var)The isNaN() function is used to check if a value is not a number.
     
12. List out some tools through which we can draw E-R diagrams for mysql.
Case Studio
Smart Draw
     
13. How can I retrieve values from one database server and store them in other database server using PHP?

we can always fetch from one database and rewrite to another. here is a nice solution of it.$db1 = mysql_connect(“host”,”user”,”pwd”)
mysql_select_db(“db1?, $db1);$res1 = mysql_query(“query”,$db1);$db2 = mysql_connect(“host”,”user”,”pwd”)
mysql_select_db(“db2?, $db2);$res2 = mysql_query(“query”,$db2);At this point you can only fetch records from you previous ResultSet,
i.e $res1 – But you cannot execute new query in $db1, even if yousupply the link as because the link was overwritten by the new db.so at this point the following script will fail $res3 = mysql_query(“query”,$db1); //this will failSo how to solve that?

take a look below.
$db1 = mysql_connect(“host”,”user”,”pwd”)
mysql_select_db(“db1?, $db1);
$res1 = mysql_query(“query”,$db1);

$db2 = mysql_connect(“host”,”user”,”pwd”, true)
mysql_select_db(“db2?, $db2);
$res2 = mysql_query(“query”,$db2);

So mysql_connect has another optional boolean parameter which indicates whether a link will be created or not. as we connect to the $db2 with this optional parameter set to ‘true’, so both link will remain live.

now the following query will execute successfully.$res3 = mysql_query(“query”,$db1);

Thanks goes to Hasan and Hasin for this solution.
     
13. List out the predefined classes in PHP?

Directory
stdClass
__PHP_Incomplete_Class
exception
php_user_filter
     
14. How can I make a script that can be bi-language (supports English, German)?

You can maintain two separate language file for each of the language. all the labels are putted in both language files as variables and assign those variables in the PHP source. on runtime choose the required language option.
     
15. What are the difference between abstract class and interface?

Abstract class: abstract classes are the class where one or more methods are abstract but not necessarily all method has to be abstract.
Abstract methods are the methods, which are declare in its class but not define. The definition of those methods must be in its extending class.Interface: Interfaces are one type of class where all the methods are abstract. That means all the methods only declared but not defined. All the methods must be define by its implemented class.

16.Explain Normalization concept?

The normalization process involves getting our data to conform to three progressive normal forms, and a higher level of normalization cannot be achieved until the previous levels have been achieved (there are actually five normal forms, but the last two are mainly academic and will not be discussed).First Normal FormThe First Normal Form (or 1NF) involves removal of redundant data from horizontal rows. We want to ensure that there is no duplication of data in a given row, and that every column stores the least amount of information possible (making the field atomic).Second Normal FormWhere the First Normal Form deals with redundancy of data across a horizontal row, Second Normal Form (or 2NF) deals with redundancy of data in vertical columns. As stated earlier, the normal forms are progressive, so to achieve Second Normal Form, your tables must already be in First Normal Form.Third Normal Form I have a confession to make; I do not often use Third Normal Form. In Third Normal Form we are looking for data in our tables that is not fully dependant on the primary key, but dependant on another value in the table.
     
17. How can we find the number of rows in a table using MySQL?

Use this for mysql
>SELECT COUNT(*) FROM table_name;
     
18. How can we find the number of rows in a result set using PHP?

$result = mysql_query($sql, $db_link);
$num_rows = mysql_num_rows($result);
echo "$num_rows rows found";

19.How many ways we can we find the current date using MySQL?

SELECT CURDATE();
CURRENT_DATE() = CURDATE()
for time use
SELECT CURTIME();
CURRENT_TIME() = CURTIME()
     
20.What are the advantages and disadvantages of Cascading Style Sheets?

External Style SheetsAdvantagesCan control styles for multiple documents at once. Classes can be created for use on multiple HTML element types in many documents.Selector and grouping methods can be used to apply styles under complex contextsDisadvantagesAn extra download is required to import style information for each document The rendering of the document may be delayed until the external style sheet is loaded Becomes slightly unwieldy for small quantities of style definitionsEmbedded Style Sheets

Advantages

Classes can be created for use on multiple tag types in the document.Selector and grouping methods can be used to apply styles under complex contexts. No additional downloads necessary to receive style information

Disadvantages

This method can not control styles for multiple documents at once Inline Styles

Advantages

Useful for small quantities of style definitions. Can override other style specification methods at the local level so only exceptions need to be listed in conjunction with other style methods

Disadvantages

Does not distance style information from content (a main goal of SGML/HTML). Can not control styles for multiple documents at once.Author can not create or control classes of elements to control multiple element types within the document. Selector grouping methods can not be used to create complex element addressing scenarios
     
21. What type of inheritance that PHP supports?
In PHP an extended class is always dependent on a single base class,that is, multiple inheritance is not supported. Classes are extended using the keyword ‘extends’.
     
22.What is the difference between Primary Key and Unique key?

Primary Key: A column in a table whose values uniquely identify the rows in the table. A primary key value cannot be NULL.
Unique Key: Unique Keys are used to uniquely identify each row in the
table. There can be one and only one row for each unique key value. So NULL can be a unique key.There can be only one primary key for a table but there can be more than one unique for a table.

23.How can we repair a MySQL table?

The syntex for repairing a MySQL table is REPAIR TABLENAME, [TABLENAME, ], [Quick],[Extended]
This command will repair the table specified if the quick is given the MySQL will do a repair of only the index tree if the extended is given it will create index row by row
     
24. What are the advantages of stored procedures, triggers, indexes?

A stored procedure is a set of SQL commands that can be compiled and stored in the server. Once this has been done, clients don’t need to keep re-issuing the entire query but can refer to the stored procedure.This provides better overall performance because the query has to be parsed only once, and less information needs to be sent between the server and the client. You can also raise the conceptual level by having libraries of functions in the server. However, stored procedures of course do increase the load on the database server system, as more of the work is done on the server side and less on the client (application)side.Triggers will also be implemented. A trigger is effectively a type of stored procedure, one that is invoked when a particular event occurs.For example, you can install a stored procedure that is triggered each time a record is deleted from a transaction table and that stored procedure automatically deletes the corresponding customer from a customer table when all his transactions are deleted.Indexes are used to find rows with specific column values quickly.Without an index, MySQL must begin with the first row and then read through the entire table to find the relevant rows. The larger the
table, the more this costs. If the table has an index for the columns in question, MySQL can quickly determine the position to seek to in the middle of the data file without having to look at all the data. If a table has 1,000 rows, this is at least 100 times faster than reading sequentially. If you need to access most of the rows, it is faster to read sequentially, because this minimizes disk seeks.
     
25. What is the maximum length of a table name, database name, and fieldname in MySQL?

The following table describes the maximum length for each type of identifier.

Identifier     Maximum Length
(bytes)
Database     64
Table     64
Column     64
Index     64
Alias     255

There are some restrictions on the characters that may appear in identifiers:
     
26. How many values can the SET function of MySQL take?

MySQL set can take zero or more values but at the maximum it can take 64 values
     
27. What are the other commands to know the structure of table using MySQL commands except explain command?

describe Table-Name;
     
28. How many tables will create when we create table, what are they?

The ‘.frm’ file stores the table definition.The data file has a ‘.MYD’ (MYData) extension.The index file has a ‘.MYI’ (MYIndex) extension,
     
29. What is the purpose of the following files having extensions 1) .frm 2) .myd 3) .myi? What do these files contain?

In MySql, the default table type is MyISAM.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.The ‘.frm’ file stores the table definition.The data file has a ‘.MYD’ (MYData) extension.The index file has a ‘.MYI’ (MYIndex) extension,
     
30. What is maximum size of a database in MySQL?

If the operating system or filesystem places a limit on the number of files in a directory, MySQL is bound by that constraint.The efficiency of the operating system in handling large numbers of files in a directory can place a practical limit on the number of tables in a database. If the time required to open a file in the directory increases significantly as the number of files increases, database performance can be adversely affected.The amount of available disk space limits the number of tables.MySQL 3.22 had a 4GB (4 gigabyte) limit on table size. With the MyISAM storage engine in MySQL 3.23, the maximum table size was increased to 65536 terabytes (2567 – 1 bytes). With this larger allowed table size,the maximum effective table size for MySQL databases is usually
determined by operating system constraints on file sizes, not by MySQL internal limits.The InnoDB storage engine maintains InnoDB tables within a tablespace
that can be created from several files. This allows a table to exceed the maximum individual file size. The tablespace can include raw disk partitions, which allows extremely large tables. The maximum tablespace size is 64TB.The following table lists some examples of operating system file-size limits. This is only a rough guide and is not intended to be definitive.For the most up-to-date information, be sure to check the documentation specific to your operating system.
Operating System File-size LimitLinux 2.2-Intel 32-bit 2GB (LFS: 4GB) Linux 2.4+ (using ext3 filesystem) 4TB Solaris 9/10 16TB NetWare w/NSS filesystem 8TB
Win32 w/ FAT/FAT32 2GB/4GB Win32 w/ NTFS 2TB (possibly larger)MacOS X w/ HFS+ 2TB
     
31. Give the syntax of Grant and Revoke commands?

The generic syntax for grant is as following > GRANT [rights] on [database/s] TO [username@hostname] IDENTIFIED BY
[password]
now rights can be
a) All privileges
b) combination of create, drop, select, insert, update and delete etc.We can grant rights on all databse by using *.* or some specific
database by database.* or a specific table by database.table_name username@hotsname can be either username@localhost, username@hostname
and username@% where hostname is any valid hostname and % represents any name, the *.*any condition
password is simply the password of userThe generic syntax for revoke is as following
> REVOKE [rights] on [database/s] FROM [username@hostname] now rights can be as explained above a) All privileges
b) combination of create, drop, select, insert, update and delete etc.
username@hotsname can be either username@localhost, username@hostname and username@%
where hostname is any valid hostname and % represents any name, the *.* any condition
     
32.The structure of table view buyers is as follows:

Field     Type     Null     Key     Default     Extra
user_pri_id     int(15)           PRI     null     auto_increment
userid     varchar(10)     YES           null    

the value of user_pri_id the last row 999 then What will happen in the following conditions?

Condition1: Delete all the rows and insert another row then.What is the starting value for this auto incremented field user_pri_id ,
Condition2: Delete the last row(having the field value 999) and insert another row then. What is the value for this auto incremented
field user_pri_id A:73     In both cases let the value for auto increment field be n then next row will have value n+1 i.e. 1000
     
33. What are the advantages/disadvantages of MySQL and PHP?

Both of them are open source software (so free of cost), support cross platform. php is faster then ASP and JSP.
     
34. What is the difference between GROUP BY and ORDER BY in Sql?

ORDER BY [col1],[col2],…,[coln]; Tels DBMS according to what columns it should sort the result. If two rows will hawe the same value in col1 it will try to sort them according to col2 and so on.GROUP BY [col1],[col2],…,[coln]; Tels DBMS to group results with same value of column col1. You can use COUNT(col1), SUM(col1), AVG(col1) with it, if  you want to count all items in group, sum all values or view average
     
35. What is the difference between char and varchar data types?

Set char to occupy n bytes and it will take n bytes even if u r storing a value of n-m bytes Set varchar to occupy n bytes and it will take only the required space and will not use the n bytes eg. name char(15) will waste 10 bytes if we store ‘mizan’, if each char takes a byte eg. name varchar(15) will just use 5 bytes if we store ‘mizan’, if each char takes a byte. rest 10 bytes will be free.
     
36. What is the functionality of md5 function in PHP?

Calculate the md5 hash of a string. The hash is a 32-character hexadecimal number. I use it to generate keys which I use to identify users etc. If I add random no techniques to it the md5 generated now will be totally different for the same string I am using.
     
37. How can I load data from a text file into a table?
you can use LOAD DATA INFILE file_name; syntax to load data from a text file. but you have to make sure thata) data is delimited b) columns and data matched correctly

38. How can we send mail using JavaScript?

JavaScript does not have any networking capabilities as it is designed to work on client site. As a result we can not send mails using JavaScript. But we can call the client side mail protocol mailto via JavaScript to prompt for an email to send. this requires the client to approve it.

     
39.How can we know the number of days between two given dates using MySQL?

SELECT DATEDIFF(’2007-03-07',’2005-01-01');
     
40. How can we know the number of days between two given dates using PHP?

$date1 = date(‘Y-m-d’); $date2 = ’2006-08-15';$days = (strtotime($date1) – strtotime($date2)) / (60 * 60 * 24);

41 .What is the functionality of md5 function in PHP?

Calculate the md5 hash of a string. The hash is a 32-character hexadecimal number. I use it to generate keys which I use to identify users etc. If I add random no techniques to it the md5 generated now will be totally different for the same string I am using.
    
42. How can I load data from a text file into a table?

you can use LOAD DATA INFILE file_name; syntax to load data from a text file. but you have to make sure thata) data is delimited b) columns and data matched correctly
    
43. How can we know the number of days between two given dates using MySQL?

SELECT DATEDIFF("2007-03-07","2005-01-01");
    
44. How can we know the number of days between two given dates using PHP?

$date1 = date("Y-m-d");
$date2 = "2006-08-15";
$days = (strtotime($date1) - strtotime($date2)) / (60 * 60 * 24);

45.How many ways can we get the value of current session id?

session_id() returns the session id for the current session.

46.What Is a Session?

It can be used to store information on the server for future use

47. How to include a file to a php page?

we can include a file using "include() " or "require()" function with as its parameter.

48.How do you define a constant?

Using define() directive, like define ("MYCONSTANT",150)

49.How to set cookies in PHP?

Cookies are often used to track user information Syntax: Setcookie(name, value, expire, path, domain); eg:Setcookie(?sample?, ram, time()+3600);

50.what is the use of mysql_fetch_array() function in php ?

This function returns a row from the table as an associative array or numeric array.

51.what is the use of the function " explode() " in php?

This function is used to split a string by special character or symbol in the string, we must be pass the string and splitting character as parameter into the function.

52.What is the use of "ksort" in php?

it is used for sort an array by key in reverse order.

53.differences between GET and POST methods ?

We can send 1024 bytes using GET method but POST method can transfer large amount of data and POST is the secure method than GET method .

54.How to calculate the sum of values in an array ?

"array_sum" method used for calculate sum of values in an array

55.What is SSL ?

SSL stands for Secure Sockets Layer. This is a cryptographic protocols which provide secure communications on the Internet

56.How to retrieve the data from MySQL result set ?

using the methods given below 1. mysql_fetch_row. 2. mysql_fetch_array 3. mysql_fetch_object 4. mysql_fetch_assoc

57.What is use of in_array() function in php ?

in_array used to checks if a value exists in an array

58. So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?

Crypto usage in PHP is simple, but that doesn’t mean it’s free. First off, depending on the data that you’re encrypting, you might have reasons to store a 32-bit value in the database instead of the 160-bit value to save on space. Second, the more secure the crypto is, the longer is the computation time to deliver the hash value. A high volume site might be significantly slowed down, if frequent md5() generation is required.

59.What’s the difference between htmlentities() and htmlspecialchars()?

htmlspecialchars only takes care of <, >, single quote ‘, double quote " and ampersand. htmlentities translates all occurrences of character sequences that have different meaning in HTML.

60.What’s the difference between md5(), crc32() and sha1() crypto on PHP?

The major difference is the length of the hash generated. CRC32 is, evidently, 32 bits, while sha1() returns a 128 bit value, and md5() returns a 160 bit value. This is important when avoiding collisions.

61.What’s the output of the ucwords function in this example?

$formatted = ucwords("TECHINTERVIEWS IS COLLECTION OF INTERVIEW QUESTIONS");
print $formatted;
ucwords() makes every first letter of every word capital, but it does not lower-case anything else. To avoid this, and get a properly formatted string, it’s worth using strtolower() first.

62.What’s the difference between htmlentities() and htmlspecialchars()? -

htmlspecialchars only takes care of <, >, single quote ‘, double quote " and ampersand. htmlentities translates all occurrences of character sequences that have different meaning in HTML.

63. I am writing an application in PHP that outputs a printable version of driving directions. It contains some long sentences, and I am a neat freak, and would like to make sure that no line exceeds 50 characters. How do I accomplish that with PHP?

On large strings that need to be formatted according to some length specifications, use wordwrap() or chunk_split().

64. For printing out strings, there are echo, print and printf. Explain the differences.

echo is the most primitive of them, and just outputs the contents following the construct to the screen. print is also a construct (so parentheses are optional when calling it), but it returns TRUE on successful output and FALSE if it was unable to print out the string. However, you can pass multiple parameters to echo, like:

 <?php echo 'Welcome ', 'to', ' ', 'TechInterviews!'; ?>

and it will output the string "Welcome to TechInterviews!" print does not take multiple parameters. It is also generally argued that echo is faster, but usually the speed advantage is negligible, and might not be there for future versions of PHP. printf  is a function, not a construct, and allows such advantages as formatted output, but it’s the slowest way to print out data out of echo, print and printf.

65.I want to combine two variables together:

 $var1 = 'Welcome to ';
 $var2 = 'TechInterviews.com';

What will work faster? Code sample 1:

$var 3 = $var1.$var2;

Or code sample 2:

$var3 = "$var1$var2";

Both examples would provide the same result - $var3 equal to "Welcome to TechInterviews.com". However, Code Sample 1 will work significantly faster. Try it out with large sets of data (or via concatenating small sets a million times or so), and you will see that concatenation works significantly faster than variable substitution.

66.With a heredoc syntax, do I get variable substitution inside the heredoc contents?

Yes.

67.How come the code <?php print "Contents: $arr[1]"; ?> works, but <?php print "Contents: $arr[1][2]"; ?> 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.

68.What is the difference between characters 23 and x23?

The first one is octal 23, the second is hex 23.

69.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.

70.How come the code <?php print "Contents: $arr[1]"; ?> works, but <?php print "Contents: $arr[1][2]"; ?> 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.


71.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.

72.What does a special set of tags <?= and ?> do in PHP?

The output is displayed directly to the browser.

73.What’s the difference between include and require?

It’s how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.

74.How do you define a constant?

Via define() directive, like define ("MYCONSTANT", 100);

75.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.

76. When are you supposed to use endif to end the conditional statement?

When the original if was followed by : and then the code block without braces.

77.How do you pass a variable by value?

Just like in C++, put an ampersand in front of it, like $a = &$b

78.Will comparison of string "10" and integer 11 work in PHP?

Yes, internally PHP will cast everything to the integer type, so numbers 10 and 11 will be compared.

79.How do I find out the number of parameters passed into function?

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


80.When are you supposed to use endif to end the conditional statement?

When the original if was followed by : and then the code block without braces.

81.If the variable $a is equal to 5 and variable $b is equal to character a, what’s the value of $$b?

100, it’s a reference to existing variable.

82.Explain the ternary conditional operator in PHP?

Expression preceding the ? is evaluated, if it’s true, then the expression preceding the : is executed, otherwise, the expression following : is executed.

83.What’s the difference between accessing a class method via -> and via?

is allowed to access methods that can perform static operations, i.e. those, which do not require object initialization.

84.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.

85.Are objects passed by value or by reference?

Everything is passed by value.

86.Why doesn’t the following code print the newline properly? 

  <?php
            $str = ‘Hello, there.nHow are you?nThanks for visiting TechInterviews’;
            print $str;
    ?>
Because inside the single quotes the n character is not interpreted as newline, just as a sequence of two characters - and n.

87.How do you call a constructor for a parent class?

parent::constructor($value)

88.What does a special set of tags <?= and ?> do in PHP?

The output is displayed directly to the browser.How do you define a constant?

89.What are the differences between require and include, include_once?

require_once() and include_once() are both the functions to include and evaluate the specified file only once. If the specified file is included previous to the present call occurrence, it will not be done again.But require() and include() will do it as many times they are asked to do.

90.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”

91.How can we submit from without a submit button?

We can use a simple JavaScript code linked to an event trigger of any form field. In the JavaScript code, we can call the document.form.submit() function to submit the form.

92.What is meant by nl2br()?

    Nl2br Inserts HTML line breaks before all newlines in a string string nl2br (string); For example: echo nl2br("god bless
    you") will output "god bless
    you" to your browser.

93.How can we encrypt the username and password using php?

You can encrypt a password with the following Mysql>SET PASSWORD=PASSWORD("Password");    We can encode data using base64_encode($string) and can decode using base64_decode($string);

94.How many ways can we get the value of current session id?

session_id() function returns the session id for the current session.

95.How can we destroy the cookie?

Set same the cookie in past

96.How can we destroy the session, how can we unset the variable of a session?

session_destroy and session_unset

97.How many values can the SET function of mysql takes?

Mysql set can take zero or more values but at the maximum it can take 64 values

98.What is mean by LAMP?

LAMP means combination of Linux, Apache, MySQL and PHP

99. How do you make one way encryption for your passwords in PHP?

Using md5 function or sha1 function

100.Explain about PHP looping?

Looping statements are used in PHP to execute the code for a developer defined number of times. PHP has these following looping statements they are while, do while, for and for each. Foreach is used to loop a block of code in each element in an array.

101.What are the different tables present in mysql?

    Total 5 types of tables we can create

    1. MyISAM

    2. Heap

    3. Merge

    4. InnoDB

    5. ISAM

    6. BDB

    MyISAM is the default storage engine as of MySQL 3.23.

102.What is the functionality of the function htmlentities?

htmlentities Convert all applicable characters to HTML entities This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities.

103.What is the difference between the functions unlink and unset?

Unlink() deletes the given file from the file system.
unset() makes a variable undefined.


104.What is the difference between include and require?

If you require a file and it cannot be found, the script will terminate with a fatal error. If you use include then you will get an error but the script will continue to execute. Therefore when the information you wish to reference from another file is essential to the correct running of a page, use require.


105.How do you get the user's ip address in PHP?

Using the server variable: $_SERVER['REMOTE_ADDR']

0 comments:

Post a Comment