php interview questions

Solutions on MaxInterview for php interview questions by the best coders in the world

showing results for - "php interview questions"
Neal
20 Jan 2019
1# 27 basics questions for php Interview
2
31) What is PHP?
4PHP is a web language based on scripts that allow developers to dynamically create generated web pages.
5
62) What do the initials of PHP stand for?
7PHP means PHP: Hypertext Preprocessor.
8
93) Which programming language does PHP resemble?
10PHP syntax resembles Perl and C
11
124) What does PEAR stand for?
13PEAR means PHP Extension and Application Repository. It extends PHP and provides a higher level of programming for web developers.
14
155) What is the actually used PHP version?
16Version 7.1 or 7.2 is the recommended version of PHP.
17
186) How do you execute a PHP script from the command line?
19Just use the PHP command line interface (CLI) and specify the file name of the script to be executed as follows:
20php script.php
21
227) How to run the interactive PHP shell from the command line interface?
23Just use the PHP CLI program with the option -a as follows:
24php -a
25
268) What is the correct and the most two common way to start and finish a PHP block of code?
27The two most common ways to start and finish a PHP script are:
28 <?php [   ---  PHP code---- ] ?> and <? [---  PHP code  ---] ?>
29
309) How can we display the output directly to the browser?
31To be able to display the output directly to the browser, we have to use the special tags <?= and ?>.
32
3310) What is the main difference between PHP 4 and PHP 5?
34PHP 5 presents many additional OOP (Object Oriented Programming) features.
35
3611) Is multiple inheritance supported in PHP?
37PHP supports only single inheritance; it means that a class can be extended from only one single class using the keyword extended.
38
3912) What is the meaning of a final class and a final method?
40final is introduced in PHP5. Final class means that this class cannot be extended and a final method cannot be overridden.
41
4213) How is the comparison of objects done in PHP?
43We use the operator == to test is two objects are instanced from the same class and have same attributes and equal values. We can test if two objects are referring to the same instance of the same class by the use of the identity operator ===.
44
4514) How can PHP and HTML interact?
46It is possible to generate HTML through PHP scripts, and it is possible to pass pieces of information from HTML to PHP.
47
4815) What type of operation is needed when passing values through a form or an URL?
49If we would like to pass values through a form or an URL, then we need to encode and to decode them using htmlspecialchars() and urlencode().
50
5116) How can PHP and Javascript interact?
52PHP and Javascript cannot directly interact since PHP is a server side language and Javascript is a client-side language. However, we can exchange variables since PHP can generate Javascript code to be executed by the browser and it is possible to pass specific variables back to PHP via the URL.
53
5417) What is needed to be able to use image function?
55GD library is needed to execute image functions.
56
5718) What is the use of the function imagetypes()?
58imagetypes() gives the image format and types supported by the current version of GD-PHP.
59
6019) What are the functions to be used to get the imags properties (size, width, and height)?
61The functions are getimagesize() for size, imagesx() for width and imagesy() for height.
62
6320) How failures in execution are handled with include() and require() functions?
64If the function require() cannot access the file then it ends with a fatal error. However, the include() function gives a warning, and the PHP script continues to execute.
65
6621) What is the main difference between require() and require_once()?
67require(), and require_once() perform the same task except that the second function checks if the PHP script is already included or not before executing it.
68(same for include_once() and include())
69
7022) How can I display text with a PHP script?
71Two methods are possible:
72<!--?php echo Method 1; print Method 2; ?-->
73
7423) How can we display information of a variable and readable by a human with PHP?
75To be able to display a human-readable result we use print_r().
76
7724) How is it possible to set an infinite execution time for PHP script?
78The set_time_limit(0) added at the beginning of a script sets to infinite the time of execution to not have the PHP error maximum execution time exceeded. It is also possible to specify this in the php.ini file.
79
8025) What does the PHP error Parse error in PHP - unexpected T_variable at line x means?
81This is a PHP syntax error expressing that a mistake at the line x stops parsing and executing the program.
82
8326) What should we do to be able to export data into an Excel file?
84The most common and used way is to get data into a format supported by Excel. For example, it is possible to write a .csv file, to choose for example comma as a separator between fields and then to open the file with Excel.
85
8627) What is the function file_get_contents() useful for?
87file_get_contents() lets reading a file and storing it in a string variable.
Lennard
04 Oct 2019
1$text = "I like programming";
2print_r (explode(" ",$text));
3$strarr = array('Pen','Pencil','Eraser');
4echo implode(" ",$strarr);
5
6
Lina
18 Aug 2017
1echo "click on the link given below in source";
queries leading to this page
interview questions and answers for experience in phpphp fresher interview questions practicalphp fresher questionphp basic questions for interview for 3 experiencedquestions about phpphp function questions answephp interview q 26 acode interview questions phptechnical interview phpinterview questions on phpphp mysql interview questions and answers for experiencedimportant php interview questionsphp coding interview questionsphp server side interview questions and answersphp to make questionsphp related questionsphp interview q 26aphp interview testscore php interview questions and answersphp mysql interview questionphp question and answersmost frequently asked php interview questionsphp interview questions and answers pdfcoding interview questions phplogical questions for php developermy sql and php interview questionsphp coding questions and answersphp interview questions top 50 questions for php developersinterviewbit phpinterview questions php developercore php code interview questionsphp interview codingphp problems questions and answersphp basic questionsphp interview quesionprogramming questions on phpphp interview coding questionsphp interview questions for freshersinterview questions phpphp programming questions for interviewphp and mysql interview questionsphp interview code questionsphp questionsphp common interview questions quoracore php code interview questions and answersinterview questions in phpphp questionbasic php interview questionphp interview questions pdfphp basics for interviewphp telephonic interview questions and answerstop viva questions for phpphp problem solving interview questionsphp fundamentals for interviewtoptal php interview questionsphp interview programming questionsphp form interview questionsinterview php questions easycore php practical interview questions and answersphp interview practicephp senior interview questionsphp top 10 interview questionscore php interview taskcore php interview quentionphp interview projectphp interview questions and answers for freshersphp interviewinterveiw questions for phpphp company interviewbasic php coding questionsphp files interview questionsphp technical interview questionsphp intermediate interview questionswhy you choose php interview questionswhat is php interview questionslogical programming interview questions in phpphp interview programsadvanced php interview questions and answers for experiencedmysql interview questions in phptop 100 php interview questionscore php interview questionstop php interview questions and answers for experiencedphp interview tests for interviewersphp code questionsphp questions 26 answersphp job interview questionsphp related questions for interviewinterview php programming questionsphp most popular interview quesitonphp backend interview questionsinterview php questions and answers for freshers in itcoding interview questions php mysqlphp developer job interview questionsphp basic viva questionsphp interview questions topphp interview questions for experienced professionalsphp tutorial point interview questionsphp interview tastsphp output based interview questionsphp interview quesionsphp questions asked in interview for experienced candidatesquestions for php interviewphp interview questions for freshserbasic phps interview questionsphp query interview questions and answers for experiencedphp interview questions ansphp question answerbasics of php for interviewsenior php interview questionsphp basic questions and answersmysql database php interview questionsphp and mysql interview questions and answersphp developer questions for interviewcommonly asked questions for phpphp beginners level interview questions and answerphp interview mcqstechnical interview questions phpphp coding questions setcore php interview task practicalphp basic questions for interviewinterview easy questions in phpquestions asked in interview for php developersome php interview questionsadvanced interview questions in phpphp interview questions and answers for 4 year experiencephp techniqcal interview questions4 options and answers based interview questions for php experiencedphp logical interview questions and answers 24ask in phpphp inerview questionphp intervew questionslatest php interview questionsinterview question of phpfew php interview questionsphp core interview questions 2b2yearsphp interview questions answersphp coding questionstop interview questions in phpadvanced php interview questions and answersphp interview questions and answers interviewbitwhich topics of php for interviewphp latest interview questionshow to take php interview php mysql interview questionsexample question in phpphp invterview questionsphp based interview questionsinterview questions and answers of phpinterview question php technicalphp interview question inriatechnical interview questions of phpbasic php questions vivaphp developers interview questionphp array interview questionsphp viva questionsprogramming questions phpinterview questions and answers phpphp programming interview questionsphp developer interview questions for experiencedcoding questions phpphp 7 interview questionsquestion answers in php usinginterview questions php experiencedphp interview questions for 4 year experienceadvanced php interview questions for experiencedprogramming problems interview phpphp question ask in interview timephp framework interview questionsphp interview questions and answers seniorphp developer interview questionsphp interview questions for php freshersinterview questions and answers php developerphp basic questions and answers for interviewmost commom question in php interviewphp functions interview questionsphp intervie questionsquestion answer phpphp top 50simple php questionsphp basic interview questions for freshersphp code questions and answersphp interview question and answer for fresherpractice interview questions phptop questions about phpquestions and answers about phpwhat are the questions asked in php interviewphp interview questions and answers for experiencedphp interview practice questionsmost common interview question phpphp questions for experiencedphp 26 mysql interview questionsphp code interview preparephp lead interview questionsphp interview quessionbasic coding questions on mysql phpphp coding interview questions and answers for experiencedadvanced php interview questionphp technical program questionsinterview questions and answers for freshers in phpphp interview programming questions for experiencedphp interview questionphp interview practical questionstop php interview questionsphp questions interviewphp technical interview questions and answersphp interview question sphp interview for fresherphp interview question and answercore php interview questions for 3 year experiencephp freshers interview questionmost common php lavra interview questionscontact php interview questionstoptal interview questions phpbasic php questionsinterview questions and answers for php web developerguru php questionsphp interview programs for fresherslogical interview questions for phpphp onterview questionphp interview questions backendtop questions in phpinterview question on core phpphp questions and answers pdfbasic php interview programming questionsphp interview questions for 5 yearslatest php interview questions for experiencedphp questions asked in interviewphp exerienced interview questionsphp logical interview qusetionsphp basic interview questions and answers for logical programming php interview questions 5 functionsphp interview questions for freshers 2020common php interview questionscommon php interviewinterview questions for a php developerinterview php questionsphp interview programs for experiencedphp interview questions and answersphp interview questions in pdfbasic interview questions for phpphp technical interview questions for experiencedphp development interview questionsphp interview questions and answers for experienced candidatesphp interview questions and answers for experienced tutorialspointphp question and answerphp interview questions seniorphp interview looping questions for freshersinterview in phpgeneral how to questions in phpphp technical interview questions for freshers5 questions phpphp logical interview questionsphp interviewinriaphp backend interview questionphp expert interview questionsphp experience interview questions and answersphp freshers interview questionsinterview question phpphp interview qustion and answerphp questions asked in interview timeinterview questions for freshers in phpphp interview questions and answers php interview questions and answers for fresher basic php programs php programming 2f logical interview questions and answersphp linked questionphp interview programs on functionphp html interview questions and answersinterview quiesions phpphp interview questionsviva questions on phpfor loop interview questions phpchoice based php interview questions and answersinterview questions asked for php developerprogramming interview questions and answers phptechnical questions on phpphp questions during interviewsdatabase questions in phpphp interview questions advancedphp important questions for interviewcore php programming interview questions and answerscoding interview questions with solutions in phptop php interview questions and answers for freshersphp practical questionsproblem solving interview questions phpfreshers php interview questionsbasic php interview questionscommon php questionscore php basic interview questionsphp intervie questionphp code interview questionscode samples for php interviewphp anf framework interview questionphp developer interview questions for freshersphp technical questionsphp interview questions operatorstop php questions interviewlogical interview question answer phpphp interview questions advancephp questions and answers systemquestions related to php coding standardsphp interview questions and answers for 10 year experienceinterview questions of phpphp questions for interviewjunior php interview questionsphp engineer interview questionsbasic php questions and answersphp web architecture interview questionsmysql interview questions for experienced php developersphp advanced interview questionsphp exam interview questionsphp intervieew questionsall php interview questionsphp coding questionslogical interview questions in phpphp inteview questionsinterview question for php experiencetechnical php interview questionsphp interview questions codingphp starts questions8 2b php interview questionsphp basic interview questionsphp interview querytionswhere i can ask questions about phpphp interiew questionsacing a php interviewonline quiz using php project interviwe questionphp interview quesstionphp interview qusetionsbasic php interview questions for fresherssharp php questionsphp interview technical questionsphp interview questioninteview questions on phpphp basic interview questions and answersphp programming interview questions for experiencedphp oop interview questionswhat to learn for php interviews questions and answersphp interview questions juniorphp logical interview question programming questions on phpphp questions and answersphp coding interview questionphp interview experince questionsphp logical programming interview questions and answers for experiencedbasic php programming questionsphp data structure interview questionsphp most asked questionsphp intreview questionask questions in phpphp interview advanced questions and answersinterview question and answer for phpphp experienced interview questionsphp development for beginners interview questionsphp function interviewphp developer interview questions and answers for experiencedphp question asked in interview timequestions techniques phpphp sql interview questionsphp interview qiestionshp php interview questionsphp database interview questionssample php write questionsphp question with answerphp fundamentals interview questionsquestions to ask php developer interviewphp core interview questionsphp interview vrageninterview questions for phpinterview questions for php developermysql php interview questionstnq php interview questionscore php basic interview practical questionsphp interivew questionsadvanced php interview questionsphp interview questions for 4 years experiencephp concepts for interviewfrequently asked php interview questionsquestion ask for phpphp important question in interviewcommone php questions interviewbasic questions for php interviewphp sql questionsmost important php interview questions and answersinterview question in phpphp questions to ask in an interviewphp client interview questionsphp interview taskslogical questions for php interviewcore php interview questionsphp interview questions and answers 2021programming interview questions phpsome basic interview questions phptop 10 php interview questions and answersphp interview questions experiencedtricky interview questions about phpphp developer interview questio nsphp functions list for interview questions and answersphp interview questions and answers for experienced web developerphp interview interviewbitsenior php questionsphp practical interview questionsphp programs for interviewphp common interview questionsphp and interview questionstechnical interview questions for phpphp interview questionsinterview questions about phpphp interview questions umniahprogram for technical interview in phpquestion language phpphp interview questions for fresherphp frequently asked questionsinterview questions for freshers phpphp experienced interview questions and answers 2021interview questions of php developerphp interview questions ans answersphp interview questions for 1 year experiencephp project manger interview questionsguru php interview questionsphp programming questionsinterview questions related phpphp interview questions for experiencephp logic interview questionsphp practical questions and answersphp interview questions for experiencedphp all questions and answersphp interview quetionsfunctions in php interview questionsinterview question i phpphp sample project for interviewquestion phpphp questions in interviewbasic questions of phpphp interview questions with answersphp simple interview questionsask questions in php ctloop interview questions phpphp interview questonsphp fresher interview questionsphp interview questions tutorialspointhow to prepare for php developer interviewphp basic interview questions for experiencedphp core interview noteshtml 26 css 26 php interview questioninterview question on phplogical interview questions and answers phpphp interview questions