PHP Training in chandigarh - TOP 10 Q/ans

 PHP Training in chandigarh - TOP 10 Q/ans


1 .  What is PHP?    

PHP introduction :-

PHP is a server script language that is commonly used for web applications. PHP
 has many frames and cms to create websites. Indeed, even a non-specialized 
individual can make locales that utilization CMS.WordPress, osCommerce are 
popular CMS of php. It is likewise a question situated programming dialect, for
 example, Java, C-sharp, and so forth. It is very easy to learn.

2.  What is the use of "echo" in php?    
Used to print data on the web page, example: <? Php echo 'Car insurance'; ?>, 
The following code print the text on the web page

3.  How to include a file to a php page?    
We can include a file with the "include ()" or "require ()" function with the path of the file
 as a parameter.

4.  What's the difference between include and require?    
If the file is not found by requiring (), it will cause a fatal error and will stop the execution
 of the script. In the event that the document is not found to be included (), a notice will 
be issued, however the execution will continue.
PHP training in chandigarh

5.  require_once(), require(), include().What is difference between them?    
Required () the integration and checking of a specific file, while
 requirement_once () is only performed if not already included (before the same page).
 Therefore, it is recommended to require_once () to use when you want to include a
 file where you have many functions, for example. In this way, make sure you do 
not include the file multiple times and you will not get the "redeclared function" error.

6. Differences between GET and POST methods ?    
We can send 1024 bytes utilizing the GET technique, yet the POST strategy can exchange 
a lot of information and POST is the certain strategy for the GET strategy.

7. How to declare an array in php?    
Eg : var $arr = array('apple', 'grape', 'lemon');

8.   What is the use of 'print' in php?    
This isn't really a genuine capacity, It is a dialect build. So you can use without enclosures 
with its contention list.
Example print('PHP Interview questions');
print 'Job Interview ');    

9 .  What is use of in_array() function in php ?    
in_array used to checks if a value exists in an array

10.  What is use of count() function in php ?    
count() is used to count all elements in an array, or something in an object

11.  What's the difference between include and require?    
It's how they handle failures. In the event that the document isn't found by require(), it will 
cause a lethal blunder and end the execution of the content. If the file is not found by
 include(), a warning will be issued, but execution will continue.

12.  What is the difference between Session and Cookie?    
The primary distinction amongst sessions and treats is that sessions are put away on 
the server, and treats are put away on client PCs in the content document organize. 
Cookies can not handle multiple variables while the session can handle multiple variables .. 
We can set the expiration for a cookie, The session will remain active as long as the 
browser is open. Users do not have access to the data you store in Session, Because 
it is stored on the server.Session is mainly used for login / logout purposes while cookies
 used for monitoring user activity

12. How to set cookies in PHP?    
Setcookie("sample", "ram", time()+3600);

13.  How to Retrieve a Cookie Value?    
eg : echo $_COOKIE["user"];

14. How to create a session? How to set a value in session ? How to Remove data from 
a session?    
Create session : session_start();
Set value into session : $_SESSION['USER_ID']=1;
Remove data from a session : unset($_SESSION['USER_ID'];    

15.  what types of loops exist in php?    
for,while,do while and foreach (NB: You should learn its usage)

More information join Php training in chandigarh provides by cbitss technologies .

0 comments:

Post a Comment