SlideShare une entreprise Scribd logo
1  sur  6
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Online Food Ordering System
Online Food Ordering SystemOnline Food Ordering System
Online Food Ordering SystemAnkita Jangir
 
CS8651 Internet Programming - Basics of HTML, HTML5, CSS
CS8651   Internet Programming - Basics of HTML, HTML5, CSSCS8651   Internet Programming - Basics of HTML, HTML5, CSS
CS8651 Internet Programming - Basics of HTML, HTML5, CSSVigneshkumar Ponnusamy
 
Web Application Development using PHP and MySQL
Web Application Development using PHP and MySQLWeb Application Development using PHP and MySQL
Web Application Development using PHP and MySQLGanesh Kamath
 
Class Diagram for Online Examination system
Class Diagram for Online Examination systemClass Diagram for Online Examination system
Class Diagram for Online Examination systemHASIM ALI
 
Pharmacy management system project report
Pharmacy management system project reportPharmacy management system project report
Pharmacy management system project reportDipta Roy
 
Web based tourism system
Web based tourism system Web based tourism system
Web based tourism system Shivangi Singh
 
Introduction to Virtualization
Introduction to VirtualizationIntroduction to Virtualization
Introduction to VirtualizationRahul Hada
 
srs for railway reservation system
 srs for railway reservation system srs for railway reservation system
srs for railway reservation systemkhushi kalaria
 
Pharmacy management system
Pharmacy management systemPharmacy management system
Pharmacy management systemsudiahmad1
 
HOSPITAL MANAGEMENT SYSTEM ANDROID
HOSPITAL MANAGEMENT SYSTEM ANDROIDHOSPITAL MANAGEMENT SYSTEM ANDROID
HOSPITAL MANAGEMENT SYSTEM ANDROIDFoysal Mahamud Elias
 
Hotel Management System SRS
Hotel Management System SRS Hotel Management System SRS
Hotel Management System SRS Paras
 
Uml diagram for_hospital_management_system
Uml diagram for_hospital_management_systemUml diagram for_hospital_management_system
Uml diagram for_hospital_management_systemPradeep Bhosale
 
Software Re-Engineering in Software Engineering SE28
Software Re-Engineering in Software Engineering SE28Software Re-Engineering in Software Engineering SE28
Software Re-Engineering in Software Engineering SE28koolkampus
 
Pharmacy management system fyp documentation
Pharmacy management system fyp documentationPharmacy management system fyp documentation
Pharmacy management system fyp documentationAbubakr Cheema
 
Lecture 02 fundamental concepts of internet and www khalid khan
Lecture 02 fundamental concepts of internet and www khalid khanLecture 02 fundamental concepts of internet and www khalid khan
Lecture 02 fundamental concepts of internet and www khalid khanKhalid Khan
 
Introduction to System, Simulation and Model
Introduction to System, Simulation and ModelIntroduction to System, Simulation and Model
Introduction to System, Simulation and ModelMd. Hasan Imam Bijoy
 

Tendances (20)

Online Food Ordering System
Online Food Ordering SystemOnline Food Ordering System
Online Food Ordering System
 
CS8651 Internet Programming - Basics of HTML, HTML5, CSS
CS8651   Internet Programming - Basics of HTML, HTML5, CSSCS8651   Internet Programming - Basics of HTML, HTML5, CSS
CS8651 Internet Programming - Basics of HTML, HTML5, CSS
 
Web Application Development using PHP and MySQL
Web Application Development using PHP and MySQLWeb Application Development using PHP and MySQL
Web Application Development using PHP and MySQL
 
Class Diagram for Online Examination system
Class Diagram for Online Examination systemClass Diagram for Online Examination system
Class Diagram for Online Examination system
 
Pharmacy management system project report
Pharmacy management system project reportPharmacy management system project report
Pharmacy management system project report
 
3 tier architecture
3 tier architecture3 tier architecture
3 tier architecture
 
Web based tourism system
Web based tourism system Web based tourism system
Web based tourism system
 
Introduction to Virtualization
Introduction to VirtualizationIntroduction to Virtualization
Introduction to Virtualization
 
Session and Cookies
Session and CookiesSession and Cookies
Session and Cookies
 
Middleware Technologies ppt
Middleware Technologies pptMiddleware Technologies ppt
Middleware Technologies ppt
 
srs for railway reservation system
 srs for railway reservation system srs for railway reservation system
srs for railway reservation system
 
Pharmacy management system
Pharmacy management systemPharmacy management system
Pharmacy management system
 
HOSPITAL MANAGEMENT SYSTEM ANDROID
HOSPITAL MANAGEMENT SYSTEM ANDROIDHOSPITAL MANAGEMENT SYSTEM ANDROID
HOSPITAL MANAGEMENT SYSTEM ANDROID
 
Hotel Management System SRS
Hotel Management System SRS Hotel Management System SRS
Hotel Management System SRS
 
Uml diagram for_hospital_management_system
Uml diagram for_hospital_management_systemUml diagram for_hospital_management_system
Uml diagram for_hospital_management_system
 
Software Re-Engineering in Software Engineering SE28
Software Re-Engineering in Software Engineering SE28Software Re-Engineering in Software Engineering SE28
Software Re-Engineering in Software Engineering SE28
 
Pharmacy management system fyp documentation
Pharmacy management system fyp documentationPharmacy management system fyp documentation
Pharmacy management system fyp documentation
 
Lecture 02 fundamental concepts of internet and www khalid khan
Lecture 02 fundamental concepts of internet and www khalid khanLecture 02 fundamental concepts of internet and www khalid khan
Lecture 02 fundamental concepts of internet and www khalid khan
 
Introduction to System, Simulation and Model
Introduction to System, Simulation and ModelIntroduction to System, Simulation and Model
Introduction to System, Simulation and Model
 
Google App Engine ppt
Google App Engine  pptGoogle App Engine  ppt
Google App Engine ppt
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
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
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Dernier (20)

What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
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
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

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