SlideShare a Scribd company logo
1 of 6
Download to read offline
This copy is registered to Núria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain




                                          Practice Exam Questions


                 1. Which of the following strings are not valid modes for the       fopen()   function?
                     A. a+b
                     B. b+a
                       C.    at
                        D.   w
                        E.   x+

                 2. Consider the following piece of code:
                        <?php
                        $arr = array(3 => “First”, 2=>“Second“, 1=>“Third“);
                        list (, $result) = $arr;
                        ?>

                     After running it, the value of $result would be
                       A. First
                       B. Second
                       C. Third
                       D. This piece of code will not run, but fail with a parse error.

                 3. In standard SQL-92, which of these situations do not require or cannot be handled
                    through the use of an aggregate SQL function? (Choose 2)
                      A. Calculating the sum of all the values in a column.
                      B. Determining the minimum value in a result set.
                      C. Grouping the results of a query by one or more fields.
                      D. Calculating the sum of all values in a column and retrieving all the values of
                          another column that is not part of an aggregate function or GROUP BY clause.
                      E. Determining the mean average of a column in a group of rows.

                 4. Multidimensional arrays can be sorted using the ______ function.
This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain


    210       Practice Exam Questions


                 5. When using the default session handler files for using sessions, PHP stores
                    session information on the harddrive of the webserver.When are those session
                    files cleaned up?
                       A. PHP will delete the associated session file when session_destroy() is
                            called from within a script.
                       B. When the function session_cleanup() is called, PHP will iterate over all
                            session files, and delete them if they exceeded the session timeout limit.
                       C. When the function session_start() is called, PHP will iterate over all
                            session files, and delete them if they exceeded the session timeout limit.
                       D. When the function session_start() is called, PHP will sometimes iterate
                            over all session files, and delete them if they exceeded the session timeout
                            limit.
                       E. Session files are never removed from the filesystem, you need to use an auto-
                            mated script (such as a cronjob) to do this.

                 6. What is the order of parameters in the mail() function?
                     A. subject, to address, extra headers, body
                     B. to address, subject, extra headers, body
                     C. to address, subject, body, extra headers
                     D. subject, to address, body, extra headers

                 7. Which of the following statements are correct? (Choose 3)
                     A. sprintf() does not output the generated string.
                     B. printf(“%2s%1s“, “ab“, “c“) outputs the string abc.
                       C. vprintf() takes at least one parameter; the first parameter is the formatting
                          string and the following parameters are the arguments for the ‘%’
                          placeholders.
                       D. printf(“%c“, “64“) will output @ and not 6.
                       E. sprintf(“%3.4f“, $x) outputs more than 7 characters.
                       F. number_format() inserts thousands of separators and decimal points differ-
                          ent from (,) and (.) respectively, while printf() like functions always use
                          (.) as decimal point.
This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain


                                                                                      Practice Exam Questions     211


                 8. The requirement is to return true for the case in which a string $str contains
                    another string $substr after the first character of $str? Which of the following
                    will return true when string $str contains string $substr, but only after the first
                    character of $str?
                    I.
                           <?php
                                     function test($str, $substr) {
                                             return strpos(substr($str,1), $substr) >= 0;
                                     }
                           ?>

                     II.
                           <?php
                                     function test($str, $substr) {
                                             return strrchr($str, $substr) !== false;
                                     }
                           ?>

                     III.
                           <?php
                                     function test($str, $substr) {
                                             return strpos($str, $substr) > 0;
                                     }
                           ?>

                       A.       I only
                       B.       II only
                       C.       III only
                       D.       I and II
                       E.       I and III
                       F.       II and III

                 9. Which of the features listed below do not exist in PHP4? (Choose 2)
                     A. Exceptions
                     B. Preprocessor instructions
                     C. Control structures
                        D. Classes and objects
                        E. Constants
This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain


    212       Practice Exam Questions


               10. What is the output of the following code snippet?
                            <?php
                               class Vehicle {
                               }

                                 class Car extends Vehicle {
                                 }

                                 class Ferrari extends Car {
                                 }

                                 var_dump(get_parent_class(“Ferrari”));
                            ?>

                       A.   string(7) “Vehicle“
                       B.   string(3) “Car“
                       C.   array(2) {
                                             [0]=>
                                             string(7) “vehicle“
                                             [1]=>
                                             string(3) “car“
                                        }

               11. The following PHP script is designed to subtract two indexed arrays of numbers.
                   Which statement is correct?
                            <?php

                                 $a = array(5, 2, 2, 3);
                                 $b = array(5, 8, 1, 5);

                                 var_dump(subArrays($a, $b));

                                 function
                                 subArrays($arr1,
                                          $arr2)
                                 {
                                          $c = count($arr1);
                                          if
                                          ($c != count($arr2))
                                          return
                                 null;
This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain


                                                                                      Practice Exam Questions     213


                                 for($i = 0;
                                         $i < $c;
                                         $i++)

                                         $res[$i]
                                         $arr1[$i] - $arr2[$i];

                                 return $res;

                                 }
                            ?>

                       A.   The script is valid.
                       B.   Assignments must be made on a single line.
                       C.   It has too many linefeed characters between statements.
                       D.   No, the script is missing curly braces.
                       E.   Yes it is valid, but the script will not work as expected.

                12. What is the purpose of the escapeshellarg() function?
                     A. Removing malicious characters.
                     B. Escaping malicious characters.
                     C. Creating an array of arguments for a shell command.
                     D. Preparing data to be used as a single argument in a shell command.
                     E. None of the above.

                13. The _________ function can be used to determine if the contents of a string can
                    be interpreted as a number.
                14. Assume $comment contains a string.Which PHP statement prints out the first 20
                    characters of $comment followed by three dots (.)?
                      A. print substr($comment, 20) . ‘...‘;
                      B. print substr_replace($comment, ‘...‘, 20);
                      C. print substr($comment, 20, strlen($comment)) . ‘...‘;
                      D. print substr_replace($comment, 20, ‘...‘);

                15. What is the name of the function that you should use to put uploaded files into a
                    permanent location on your server?
                16. If you have a file handle for an opened file, use the __________ function to send
                    all data remaining to be read from that file handle to the output buffer.
This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain


    214       Practice Exam Questions


               17. Which of the following sentences are not true? (Choose 2)
                    A. strpos() allows searching for a substring in another string.
                    B. strrpos() allows searching for a substring in another string.
                    C. strpos() and strrchr() return -1 if the second parameter is not a sub-
                       string of the first parameter.
                         D. strpos() and strrpos() can return a value that is different from an integer.
                         E. The second parameter to substr() is the length of the substring to extract.
                         F. strstr() returns false if the substring specified by its second parameter is
                            not found in the first parameter.

               18. Which of the following sentences are correct? (Choose 2)
                    A. time() + 60*60*100 returns the current date and time plus one hour.
                    B. time() + 24*60*60 returns the current date and time plus one day.
                    C. time() + 24*60*60*100 returns the current date and time plus one day


              Answers
                1.   B
                2.   C
                3.   C and D
                4.   array_multisort      or   array_multisort()
                5.   D
                6.   C
                7.   A, D, and F
                8.   C
                9.   A and B
               10.   A
               11.   B
               12.   D
               13.   is_numeric    or   is_numeric()
               14.   B
               15. move_uploaded_file or move_uploaded_file()
               16. fpassthru or fpassthru()
               17. C and E
               18. B

More Related Content

What's hot

Objects and classes in Visual Basic
Objects and classes in Visual BasicObjects and classes in Visual Basic
Objects and classes in Visual BasicSangeetha Sg
 
Installation instruction of Testlink
Installation instruction of TestlinkInstallation instruction of Testlink
Installation instruction of Testlinkusha kannappan
 
Lecture-1: Introduction to web engineering - course overview and grading scheme
Lecture-1: Introduction to web engineering - course overview and grading schemeLecture-1: Introduction to web engineering - course overview and grading scheme
Lecture-1: Introduction to web engineering - course overview and grading schemeMubashir Ali
 
Java Input Output (java.io.*)
Java Input Output (java.io.*)Java Input Output (java.io.*)
Java Input Output (java.io.*)Om Ganesh
 
the Concept of Object-Oriented Programming
the Concept of Object-Oriented Programmingthe Concept of Object-Oriented Programming
the Concept of Object-Oriented ProgrammingAida Ramlan II
 
Laravel presentation
Laravel presentationLaravel presentation
Laravel presentationToufiq Mahmud
 
Dynamic content generation
Dynamic content generationDynamic content generation
Dynamic content generationEleonora Ciceri
 
Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Peter R. Egli
 
Jdbc architecture and driver types ppt
Jdbc architecture and driver types pptJdbc architecture and driver types ppt
Jdbc architecture and driver types pptkamal kotecha
 
Oops concepts in php
Oops concepts in phpOops concepts in php
Oops concepts in phpCPD INDIA
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.netSHADAB ALI
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NETRajkumarsoy
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in javaRaghu nath
 
Web Server - Internet Applications
Web Server - Internet ApplicationsWeb Server - Internet Applications
Web Server - Internet Applicationssandra sukarieh
 

What's hot (20)

Objects and classes in Visual Basic
Objects and classes in Visual BasicObjects and classes in Visual Basic
Objects and classes in Visual Basic
 
Installation instruction of Testlink
Installation instruction of TestlinkInstallation instruction of Testlink
Installation instruction of Testlink
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
Lecture-1: Introduction to web engineering - course overview and grading scheme
Lecture-1: Introduction to web engineering - course overview and grading schemeLecture-1: Introduction to web engineering - course overview and grading scheme
Lecture-1: Introduction to web engineering - course overview and grading scheme
 
Java Input Output (java.io.*)
Java Input Output (java.io.*)Java Input Output (java.io.*)
Java Input Output (java.io.*)
 
the Concept of Object-Oriented Programming
the Concept of Object-Oriented Programmingthe Concept of Object-Oriented Programming
the Concept of Object-Oriented Programming
 
Laravel presentation
Laravel presentationLaravel presentation
Laravel presentation
 
Dynamic content generation
Dynamic content generationDynamic content generation
Dynamic content generation
 
Html frames
Html framesHtml frames
Html frames
 
Php Lecture Notes
Php Lecture NotesPhp Lecture Notes
Php Lecture Notes
 
Oops in PHP
Oops in PHPOops in PHP
Oops in PHP
 
Remote Method Invocation (RMI)
Remote Method Invocation (RMI)Remote Method Invocation (RMI)
Remote Method Invocation (RMI)
 
Laravel ppt
Laravel pptLaravel ppt
Laravel ppt
 
Jdbc architecture and driver types ppt
Jdbc architecture and driver types pptJdbc architecture and driver types ppt
Jdbc architecture and driver types ppt
 
Oops concepts in php
Oops concepts in phpOops concepts in php
Oops concepts in php
 
Introduction to asp.net
Introduction to asp.netIntroduction to asp.net
Introduction to asp.net
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
Shadows Effects in CSS
Shadows Effects in CSSShadows Effects in CSS
Shadows Effects in CSS
 
Multithreading in java
Multithreading in javaMultithreading in java
Multithreading in java
 
Web Server - Internet Applications
Web Server - Internet ApplicationsWeb Server - Internet Applications
Web Server - Internet Applications
 

Viewers also liked

Top 100 PHP Interview Questions and Answers
Top 100 PHP Interview Questions and AnswersTop 100 PHP Interview Questions and Answers
Top 100 PHP Interview Questions and AnswersVineet Kumar Saini
 
PHP Technical Questions
PHP Technical QuestionsPHP Technical Questions
PHP Technical QuestionsPankaj Jha
 
Zend PHP 5.3 Demo Certification Test
Zend PHP 5.3 Demo Certification TestZend PHP 5.3 Demo Certification Test
Zend PHP 5.3 Demo Certification TestCarlos Buenosvinos
 
25 php interview questions – codementor
25 php interview questions – codementor25 php interview questions – codementor
25 php interview questions – codementorArc & Codementor
 
Zend Php Certification Study Guide
Zend Php Certification Study GuideZend Php Certification Study Guide
Zend Php Certification Study GuideKamalika Guha Roy
 
Questions and answers regarding white card
Questions and answers regarding white cardQuestions and answers regarding white card
Questions and answers regarding white cardrazzor56
 
Top 100 PHP Questions and Answers
Top 100 PHP Questions and AnswersTop 100 PHP Questions and Answers
Top 100 PHP Questions and Answersiimjobs and hirist
 
Useful functions for arrays in php
Useful functions for arrays in phpUseful functions for arrays in php
Useful functions for arrays in phpChetan Patel
 
Zend Certification Preparation Tutorial
Zend Certification Preparation TutorialZend Certification Preparation Tutorial
Zend Certification Preparation TutorialLorna Mitchell
 
Curso HTML5 - Temario
Curso HTML5 - TemarioCurso HTML5 - Temario
Curso HTML5 - Temariopastilla5
 
Top 100 .Net Interview Questions and Answer
Top 100 .Net Interview Questions and AnswerTop 100 .Net Interview Questions and Answer
Top 100 .Net Interview Questions and AnswerVineet Kumar Saini
 
Zend Certification PHP 5 Sample Questions
Zend Certification PHP 5 Sample QuestionsZend Certification PHP 5 Sample Questions
Zend Certification PHP 5 Sample QuestionsJagat Kothari
 
Your first 5 PHP design patterns - ThatConference 2012
Your first 5 PHP design patterns - ThatConference 2012Your first 5 PHP design patterns - ThatConference 2012
Your first 5 PHP design patterns - ThatConference 2012Aaron Saray
 
Introducción a HTML5 y CSS3 AWGR
Introducción a HTML5 y CSS3 AWGRIntroducción a HTML5 y CSS3 AWGR
Introducción a HTML5 y CSS3 AWGRvalgreens
 
Manual css3 DesarrolloWeb
Manual css3 DesarrolloWebManual css3 DesarrolloWeb
Manual css3 DesarrolloWebWalter Carmona
 
HTML5 & CSS3 in Drupal (on the Bayou)
HTML5 & CSS3 in Drupal (on the Bayou)HTML5 & CSS3 in Drupal (on the Bayou)
HTML5 & CSS3 in Drupal (on the Bayou)Mediacurrent
 

Viewers also liked (20)

1000+ php questions
1000+ php questions1000+ php questions
1000+ php questions
 
Top 100 PHP Interview Questions and Answers
Top 100 PHP Interview Questions and AnswersTop 100 PHP Interview Questions and Answers
Top 100 PHP Interview Questions and Answers
 
PHP Technical Questions
PHP Technical QuestionsPHP Technical Questions
PHP Technical Questions
 
Zend PHP 5.3 Demo Certification Test
Zend PHP 5.3 Demo Certification TestZend PHP 5.3 Demo Certification Test
Zend PHP 5.3 Demo Certification Test
 
25 php interview questions – codementor
25 php interview questions – codementor25 php interview questions – codementor
25 php interview questions – codementor
 
Zend Php Certification Study Guide
Zend Php Certification Study GuideZend Php Certification Study Guide
Zend Php Certification Study Guide
 
Questions and answers regarding white card
Questions and answers regarding white cardQuestions and answers regarding white card
Questions and answers regarding white card
 
Top 100 PHP Questions and Answers
Top 100 PHP Questions and AnswersTop 100 PHP Questions and Answers
Top 100 PHP Questions and Answers
 
Useful functions for arrays in php
Useful functions for arrays in phpUseful functions for arrays in php
Useful functions for arrays in php
 
Zend Certification Preparation Tutorial
Zend Certification Preparation TutorialZend Certification Preparation Tutorial
Zend Certification Preparation Tutorial
 
Curso HTML5 - Temario
Curso HTML5 - TemarioCurso HTML5 - Temario
Curso HTML5 - Temario
 
PHP Quiz
PHP QuizPHP Quiz
PHP Quiz
 
Top 100 .Net Interview Questions and Answer
Top 100 .Net Interview Questions and AnswerTop 100 .Net Interview Questions and Answer
Top 100 .Net Interview Questions and Answer
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 
Zend Certification PHP 5 Sample Questions
Zend Certification PHP 5 Sample QuestionsZend Certification PHP 5 Sample Questions
Zend Certification PHP 5 Sample Questions
 
Your first 5 PHP design patterns - ThatConference 2012
Your first 5 PHP design patterns - ThatConference 2012Your first 5 PHP design patterns - ThatConference 2012
Your first 5 PHP design patterns - ThatConference 2012
 
Introducción a HTML5 y CSS3 AWGR
Introducción a HTML5 y CSS3 AWGRIntroducción a HTML5 y CSS3 AWGR
Introducción a HTML5 y CSS3 AWGR
 
Manual css3 DesarrolloWeb
Manual css3 DesarrolloWebManual css3 DesarrolloWeb
Manual css3 DesarrolloWeb
 
HTML5 & CSS3 in Drupal (on the Bayou)
HTML5 & CSS3 in Drupal (on the Bayou)HTML5 & CSS3 in Drupal (on the Bayou)
HTML5 & CSS3 in Drupal (on the Bayou)
 
Browser information in PHP
Browser information in PHPBrowser information in PHP
Browser information in PHP
 

Similar to Practice exam php

C++ Programming Homework Help
C++ Programming Homework HelpC++ Programming Homework Help
C++ Programming Homework HelpC++ Homework Help
 
Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Guy Lebanon
 
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...Dhivyaa C.R
 
Comp 328 final guide
Comp 328 final guideComp 328 final guide
Comp 328 final guidekrtioplal
 
JavaScript(Es5) Interview Questions & Answers
JavaScript(Es5)  Interview Questions & AnswersJavaScript(Es5)  Interview Questions & Answers
JavaScript(Es5) Interview Questions & AnswersRatnala Charan kumar
 
Advanced Web Technology ass.pdf
Advanced Web Technology ass.pdfAdvanced Web Technology ass.pdf
Advanced Web Technology ass.pdfsimenehanmut
 
Arrays and function basic c programming notes
Arrays and function basic c programming notesArrays and function basic c programming notes
Arrays and function basic c programming notesGOKULKANNANMMECLECTC
 
Programming in C (part 2)
Programming in C (part 2)Programming in C (part 2)
Programming in C (part 2)SURBHI SAROHA
 
Java Questions
Java QuestionsJava Questions
Java Questionsbindur87
 

Similar to Practice exam php (20)

Mcq ppt Php- array
Mcq ppt Php- array Mcq ppt Php- array
Mcq ppt Php- array
 
lab4_php
lab4_phplab4_php
lab4_php
 
lab4_php
lab4_phplab4_php
lab4_php
 
Java 8 Workshop
Java 8 WorkshopJava 8 Workshop
Java 8 Workshop
 
C++ Programming Homework Help
C++ Programming Homework HelpC++ Programming Homework Help
C++ Programming Homework Help
 
Ds lab handouts
Ds lab handoutsDs lab handouts
Ds lab handouts
 
Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Data Analysis with R (combined slides)
Data Analysis with R (combined slides)
 
Chapter 2 wbp.pptx
Chapter 2 wbp.pptxChapter 2 wbp.pptx
Chapter 2 wbp.pptx
 
What is new in Java 8
What is new in Java 8What is new in Java 8
What is new in Java 8
 
cp05.pptx
cp05.pptxcp05.pptx
cp05.pptx
 
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
 
UNIT IV (4).pptx
UNIT IV (4).pptxUNIT IV (4).pptx
UNIT IV (4).pptx
 
Comp 328 final guide
Comp 328 final guideComp 328 final guide
Comp 328 final guide
 
JavaScript(Es5) Interview Questions & Answers
JavaScript(Es5)  Interview Questions & AnswersJavaScript(Es5)  Interview Questions & Answers
JavaScript(Es5) Interview Questions & Answers
 
Advanced Web Technology ass.pdf
Advanced Web Technology ass.pdfAdvanced Web Technology ass.pdf
Advanced Web Technology ass.pdf
 
Java script arrays
Java script arraysJava script arrays
Java script arrays
 
Java script arrays
Java script arraysJava script arrays
Java script arrays
 
Arrays and function basic c programming notes
Arrays and function basic c programming notesArrays and function basic c programming notes
Arrays and function basic c programming notes
 
Programming in C (part 2)
Programming in C (part 2)Programming in C (part 2)
Programming in C (part 2)
 
Java Questions
Java QuestionsJava Questions
Java Questions
 

Recently uploaded

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

Practice exam php

  • 1. This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain Practice Exam Questions 1. Which of the following strings are not valid modes for the fopen() function? A. a+b B. b+a C. at D. w E. x+ 2. Consider the following piece of code: <?php $arr = array(3 => “First”, 2=>“Second“, 1=>“Third“); list (, $result) = $arr; ?> After running it, the value of $result would be A. First B. Second C. Third D. This piece of code will not run, but fail with a parse error. 3. In standard SQL-92, which of these situations do not require or cannot be handled through the use of an aggregate SQL function? (Choose 2) A. Calculating the sum of all the values in a column. B. Determining the minimum value in a result set. C. Grouping the results of a query by one or more fields. D. Calculating the sum of all values in a column and retrieving all the values of another column that is not part of an aggregate function or GROUP BY clause. E. Determining the mean average of a column in a group of rows. 4. Multidimensional arrays can be sorted using the ______ function.
  • 2. This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain 210 Practice Exam Questions 5. When using the default session handler files for using sessions, PHP stores session information on the harddrive of the webserver.When are those session files cleaned up? A. PHP will delete the associated session file when session_destroy() is called from within a script. B. When the function session_cleanup() is called, PHP will iterate over all session files, and delete them if they exceeded the session timeout limit. C. When the function session_start() is called, PHP will iterate over all session files, and delete them if they exceeded the session timeout limit. D. When the function session_start() is called, PHP will sometimes iterate over all session files, and delete them if they exceeded the session timeout limit. E. Session files are never removed from the filesystem, you need to use an auto- mated script (such as a cronjob) to do this. 6. What is the order of parameters in the mail() function? A. subject, to address, extra headers, body B. to address, subject, extra headers, body C. to address, subject, body, extra headers D. subject, to address, body, extra headers 7. Which of the following statements are correct? (Choose 3) A. sprintf() does not output the generated string. B. printf(“%2s%1s“, “ab“, “c“) outputs the string abc. C. vprintf() takes at least one parameter; the first parameter is the formatting string and the following parameters are the arguments for the ‘%’ placeholders. D. printf(“%c“, “64“) will output @ and not 6. E. sprintf(“%3.4f“, $x) outputs more than 7 characters. F. number_format() inserts thousands of separators and decimal points differ- ent from (,) and (.) respectively, while printf() like functions always use (.) as decimal point.
  • 3. This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain Practice Exam Questions 211 8. The requirement is to return true for the case in which a string $str contains another string $substr after the first character of $str? Which of the following will return true when string $str contains string $substr, but only after the first character of $str? I. <?php function test($str, $substr) { return strpos(substr($str,1), $substr) >= 0; } ?> II. <?php function test($str, $substr) { return strrchr($str, $substr) !== false; } ?> III. <?php function test($str, $substr) { return strpos($str, $substr) > 0; } ?> A. I only B. II only C. III only D. I and II E. I and III F. II and III 9. Which of the features listed below do not exist in PHP4? (Choose 2) A. Exceptions B. Preprocessor instructions C. Control structures D. Classes and objects E. Constants
  • 4. This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain 212 Practice Exam Questions 10. What is the output of the following code snippet? <?php class Vehicle { } class Car extends Vehicle { } class Ferrari extends Car { } var_dump(get_parent_class(“Ferrari”)); ?> A. string(7) “Vehicle“ B. string(3) “Car“ C. array(2) { [0]=> string(7) “vehicle“ [1]=> string(3) “car“ } 11. The following PHP script is designed to subtract two indexed arrays of numbers. Which statement is correct? <?php $a = array(5, 2, 2, 3); $b = array(5, 8, 1, 5); var_dump(subArrays($a, $b)); function subArrays($arr1, $arr2) { $c = count($arr1); if ($c != count($arr2)) return null;
  • 5. This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain Practice Exam Questions 213 for($i = 0; $i < $c; $i++) $res[$i] $arr1[$i] - $arr2[$i]; return $res; } ?> A. The script is valid. B. Assignments must be made on a single line. C. It has too many linefeed characters between statements. D. No, the script is missing curly braces. E. Yes it is valid, but the script will not work as expected. 12. What is the purpose of the escapeshellarg() function? A. Removing malicious characters. B. Escaping malicious characters. C. Creating an array of arguments for a shell command. D. Preparing data to be used as a single argument in a shell command. E. None of the above. 13. The _________ function can be used to determine if the contents of a string can be interpreted as a number. 14. Assume $comment contains a string.Which PHP statement prints out the first 20 characters of $comment followed by three dots (.)? A. print substr($comment, 20) . ‘...‘; B. print substr_replace($comment, ‘...‘, 20); C. print substr($comment, 20, strlen($comment)) . ‘...‘; D. print substr_replace($comment, 20, ‘...‘); 15. What is the name of the function that you should use to put uploaded files into a permanent location on your server? 16. If you have a file handle for an opened file, use the __________ function to send all data remaining to be read from that file handle to the output buffer.
  • 6. This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain 214 Practice Exam Questions 17. Which of the following sentences are not true? (Choose 2) A. strpos() allows searching for a substring in another string. B. strrpos() allows searching for a substring in another string. C. strpos() and strrchr() return -1 if the second parameter is not a sub- string of the first parameter. D. strpos() and strrpos() can return a value that is different from an integer. E. The second parameter to substr() is the length of the substring to extract. F. strstr() returns false if the substring specified by its second parameter is not found in the first parameter. 18. Which of the following sentences are correct? (Choose 2) A. time() + 60*60*100 returns the current date and time plus one hour. B. time() + 24*60*60 returns the current date and time plus one day. C. time() + 24*60*60*100 returns the current date and time plus one day Answers 1. B 2. C 3. C and D 4. array_multisort or array_multisort() 5. D 6. C 7. A, D, and F 8. C 9. A and B 10. A 11. B 12. D 13. is_numeric or is_numeric() 14. B 15. move_uploaded_file or move_uploaded_file() 16. fpassthru or fpassthru() 17. C and E 18. B