PHP

 

 

1.    What is PHP?

 

PHP is the full form of Hypertext,Open source, Platform Pre Processing.It is used to receive data from the front end and store into the database and receive data from back end and make the dynamic web pages.

 

 2. What are the language used to design the PHP?

 

PHP is designed by using C and Perl and developed by Zend technologies.

 

3. Who is implement the PHP and which year?

 

PHP was implement by Rasmus Lendrofat in the year of 1995.

 

4. Mention some features of the PHP?

 

1. It is a server side scripting language.

 

2. It supports variety of server but it uses Apache.

 

3. It is supports variety of databases.

 

5. What is the current version of the PHP?

 

The current version of PHP is 5.7.1

 

6. What is the syntax of the PHP?

 

 

<?PHP

?>

 

 

   

7. What are the types of variable in PHP?

 

 

There are two types of PHP variable

 

User defined variable

 

Super global variable

 

   

8. What is the use of the echo() in PHP?

 

 

It is used to print statements and supports multiple expressions

 

 

   

9. What is the use of the Print() in PHP?

 

It is like echo but it is used to support single expression.

 

   

10. What is the work of var_dump() and isset() in PHP?

 

Var_dump() is used to get information about variable and isset() is used to check whether variable has a value or not.

 

   

 

 11. Give the output to the following program?

 

<? Php

$msg =”me”;

$$msg =”Seoghazana.com”;

Echo $me;

?>

 

 

    Output :

    Seoghazana.com

   

12. What is the difference between $msg and $$msg?

 

$msg it is a simple variable.

 

$$msg it is a variable of a variable

 

 

 

 

  13. What is meant by Array in PHP and mention it types?

 

 

Array is a collection of values in a single variable name. There are three types of arrays in PHP.

 

Numeric array

 

Associate array

 

Multi dimensional array

 

 

     

14. What is the difference between PHP and Javascript?

 

Javascript :

 

1. It is client side programming language

 

2. It is a case sensitive language

 

   PHP :

 

1. It is a server side programming language

 

2. It is not a case sensitive language.

 

 

 15.Write the program to display the date in PHP?

 

    <? Php

    date_default_timezone_set(“Asia|kolkata”);
   $d =date(“D M Y h:i A);
   Echo $d;

   ?>


 

16. Is it OOPS concept used in PHP?

 

Yes, OOPS concepts is used in PHP.

 

   

17. What is meant by string function and mention any four types of string function?

 

String function is used to handle the string.

 

addcslashes()

 

addslashes()

 

chop()

 

char()

 

echo()

 

crypt()

 

 

 

18. What is the use of the explode() and md5 in PHP?

 

Explode is used to breaks a string into an array.And md 5 is used to calculates the MD5 hash of a string.

 

 

19.Give the example to the Associative array?

 

        <?php

         $ages [‘balaji’] =”32”;

         $ages[seo] = “30”;

          $ages[‘ghazana’] = “37”;

          Echo “balaji” . “seo” . “ ghazana” “years old”;

          ?>

 

20. What is the use of the Array function in PHP world?

 

Array function is used to manipulate arrays in the PHP world.

 

 

   

21. Mention any five PHP array function?

 

 

1. array()

 

2. Array keys()

 

3. Array map()

 

4. Array merge()

 

 

 

 

 22. What is the use of the asort() in PHP?

 

 

It is used to sort an array and maintain index association.

 

 

 

 

23. Mention any five PHP math function?

 

abs()

 

acos()

 

acosh()

 

floor()

 

hexdec()

 

sin()

 

sinh()

 

 

 

24. What is the use of the $_GET in PHP?

 

 

It is used to collect values from a form with method =”get”.

 

 

 

25. What is the use of the $_post?

 

 

Variables are sent with HTTP POST are not shown in the URL.

 

Variable have no length limit.

 

 

26.Mention any three types of file system functions with their uses in PHP?

 

basename() —- Returns the filename component of a path

 

chmod() —- Change the file mode

 

chown() — Changes file owner

 

file() —– Read a file into an array

 

 

 

27. Mention the access specifier used in PHP?

 

Private

 

Public

 

Protected

 

 

 

28. What are the advantages of the OOPS in PHP?

 

Code reusability

 

Efficient coding

 

Security

 

 

 

29. What is meant by static method in PHP?

 

 

Without create any object and invoke the class using ::.  So it is called the static method.

 

 

30. What is meant by function overriding in PHP?

 

Same function name which has been shared into multiple derived class.

 

 

 31. Mention the cookies features?

 

It is a client side temporary memory storage.

 

It stores the data usually in browser

 

 

 

32. Mention the syntax to maintain the cookie and session PHP?

 

$_COOKIE[“cookiename”]; and $_SESSION[];

 

 

33. What is the lifetime of the session in PHP?

 

The lifetime of the session in PHP is 1440 seconds.

 

 

34. What is the syntax to delete a session in PHP?

 

To delete a session in PHP session_destroy();

 

 

35. What is meant by file handling in PHP?

 

It is used to create,view,upload, and download the file Data in the programming world.

 

 

36. What is the use of the If(Isec) ?

 

It  is used to check there is any value in the method.

 

 

37. What are the types of errors?

 

Notices

 

Warning

 

Fatal error

 

Parse error

 

 

38. Mention any two types of Calendar function in PHP?

 

1.unixtod()

 

2. julianToJD()

 

3. JDTojulian()

 

 

39. Mention any four types of Date and Time function in PHP?

 

date_default_timezone_get()

 

date_default_timezone_set()

 

date()

 

mktime()

 

 

40. Mention any five types of FTP function in PHP?

 

ftp_alloc()

 

ftp_cdup()

 

ftp_chdir()

 

ftp_close()

 

ftp_get()

 

ftp_login()