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

Project Planning in Software Engineering
Project Planning in Software EngineeringProject Planning in Software Engineering
Project Planning in Software EngineeringFáber D. Giraldo
 
Server Side VS Client Side
Server Side VS Client SideServer Side VS Client Side
Server Side VS Client SideCode Boxx
 
100 PHP question and answer
100 PHP  question and answer100 PHP  question and answer
100 PHP question and answerSandip Murari
 
Introduction to loaders
Introduction to loadersIntroduction to loaders
Introduction to loadersTech_MX
 
Software myths | Software Engineering Notes
Software myths | Software Engineering NotesSoftware myths | Software Engineering Notes
Software myths | Software Engineering NotesNavjyotsinh Jadeja
 
Automata theory
Automata theoryAutomata theory
Automata theorycolleges
 
Compiler design Introduction
Compiler design IntroductionCompiler design Introduction
Compiler design IntroductionAman Sharma
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Barrel Software
 
Unit 1 sepm software myths
Unit 1 sepm software mythsUnit 1 sepm software myths
Unit 1 sepm software mythsKanchanPatil34
 
Content provider in_android
Content provider in_androidContent provider in_android
Content provider in_androidPRITI TELMORE
 
COCOMO Model For Effort Estimation
COCOMO Model For Effort EstimationCOCOMO Model For Effort Estimation
COCOMO Model For Effort Estimationgrandhiprasuna
 
Organization and team structures
Organization and team structuresOrganization and team structures
Organization and team structuresNur Islam
 
Internet and open source concepts
Internet and open source conceptsInternet and open source concepts
Internet and open source conceptsSachidananda M H
 

What's hot (20)

Case study
Case studyCase study
Case study
 
Project Planning in Software Engineering
Project Planning in Software EngineeringProject Planning in Software Engineering
Project Planning in Software Engineering
 
Server Side VS Client Side
Server Side VS Client SideServer Side VS Client Side
Server Side VS Client Side
 
100 PHP question and answer
100 PHP  question and answer100 PHP  question and answer
100 PHP question and answer
 
Introduction to loaders
Introduction to loadersIntroduction to loaders
Introduction to loaders
 
Software myths | Software Engineering Notes
Software myths | Software Engineering NotesSoftware myths | Software Engineering Notes
Software myths | Software Engineering Notes
 
Automata theory
Automata theoryAutomata theory
Automata theory
 
Compiler design Introduction
Compiler design IntroductionCompiler design Introduction
Compiler design Introduction
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)
 
Web engineering cse ru
Web engineering cse ruWeb engineering cse ru
Web engineering cse ru
 
Software Crisis
Software CrisisSoftware Crisis
Software Crisis
 
DDoS Protection
DDoS ProtectionDDoS Protection
DDoS Protection
 
Unit 7
Unit 7Unit 7
Unit 7
 
Unit 1 sepm software myths
Unit 1 sepm software mythsUnit 1 sepm software myths
Unit 1 sepm software myths
 
Support NodeJS avec TypeScript Express MongoDB
Support NodeJS avec TypeScript Express MongoDBSupport NodeJS avec TypeScript Express MongoDB
Support NodeJS avec TypeScript Express MongoDB
 
Content provider in_android
Content provider in_androidContent provider in_android
Content provider in_android
 
COCOMO Model For Effort Estimation
COCOMO Model For Effort EstimationCOCOMO Model For Effort Estimation
COCOMO Model For Effort Estimation
 
Organization and team structures
Organization and team structuresOrganization and team structures
Organization and team structures
 
Internet and open source concepts
Internet and open source conceptsInternet and open source concepts
Internet and open source concepts
 
Introduction To CodeIgniter
Introduction To CodeIgniterIntroduction To CodeIgniter
Introduction To CodeIgniter
 

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
 
UNIT IV (4).pptx
UNIT IV (4).pptxUNIT IV (4).pptx
UNIT IV (4).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 ...
 
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

A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...itnewsafrica
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 

Recently uploaded (20)

A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...Zeshan Sattar- Assessing the skill requirements and industry expectations for...
Zeshan Sattar- Assessing the skill requirements and industry expectations for...
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 

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