Php Intern
Php Intern Interview Questions and Answers for Freshers
Q1. Diff between require and include
require and include are both used to include external PHP files, but require will cause a fatal error if the file is not found, while include will only produce a warning.
require is used when the included file is essential for the script to run
include is used when the included file is not essential for the script to run
require_once and include_once are used to prevent multiple inclusions of the same file
require will stop the script execution if the file is not found, while inc...read more
Q2. Diff between echo and print
Echo and print are both used to output text in PHP, but echo is faster and can output multiple values at once.
Echo is a language construct, while print is a function.
Echo can output multiple values separated by commas, while print can only output one value at a time.
Echo does not return a value, while print returns a value of 1.
Echo is faster than print because it does not need to return a value.
Example of echo: echo 'Hello World';
Example of print: print('Hello World');
Q3. Print * using loops
Printing * using loops is a basic programming exercise.
Use nested loops to print * in a pattern
Use a for loop to print * in a straight line
Use a while loop to print * until a certain condition is met
Php Intern Jobs
Interview Questions of Similar Designations
Interview experiences of popular companies
Calculate your in-hand salary
Confused about how your in-hand salary is calculated? Enter your annual salary (CTC) and get your in-hand salary
Reviews
Interviews
Salaries
Users/Month