The document discusses PHP, an open-source scripting language commonly used for web development. It can be embedded into HTML pages and is used to dynamically generate webpage content. PHP code is executed on the server and generates HTML that is sent to the browser. The document also discusses using XAMPP, a free and open-source cross-platform web server solution stack, to install and run PHP, MySQL, and Apache on your local computer for testing websites.
PHP is an open-source server-side scripting language used for web development. It was created by Rasmus Lerdorf in 1994. Some key points:
- PHP scripts are embedded into HTML pages and executed on the server side, with the output sent to the client. This allows PHP to generate dynamic web page content.
- PHP is free to use and runs on many platforms including Windows, Linux, and Mac. It is compatible with many databases like MySQL.
- The language syntax is loosely based on C and Java. Key constructs include variables, strings, arrays, functions, loops, conditional statements, and object-oriented capabilities.
- PHP files use .php extensions and code
PHP Basic and Fundamental Questions and Answers with Detail ExplanationAbdul Rahman Sherzad
These PHP basic and fundamental questions and answers with detail explanation help students and learners to think comprehensive, and to seek more to understand the concept and the root of each topic concretely.
Youtube Link: https://youtu.be/woVJ4N5nl_s
** Python Certification Training: https://www.edureka.co/data-science-python-certification-course **
This Edureka PPT on 'Python Basics' will help you understand what exactly makes Python special and covers all the basics of Python programming along with examples.
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
1. The document describes the common HTTP methods used to retrieve or send data over the web, including GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, and TRACE.
2. GET is used to retrieve a resource, HEAD is like GET but only returns headers, and POST sends data to a server like form data or file uploads.
3. PUT replaces a resource with uploaded content, DELETE removes a resource, and CONNECT establishes a tunnel. OPTIONS returns supported methods and TRACE echoes a request for debugging.
This Slide contain information about the SQL injection.
Types of SQL injection and some case study about the SQL injection and some technique so we prevent our system
This document discusses validating user input in ASP.NET applications. It describes using validation controls on both the client-side using JavaScript and server-side using C# to check fields for errors like empty values, values outside a specified range, or values that do not match a regular expression. The key validation controls covered are RequiredFieldValidator, RangeValidator, RegularExpressionValidator, CompareValidator, and CustomValidator. It emphasizes best practices of using both client-side and server-side validation for security and usability.
The document provides an overview of key concepts related to web application technologies including the HTTP protocol, web functionality, and encoding schemes. It discusses HTTP requests and responses, common HTTP methods like GET and POST, URLs, REST, HTTP headers, cookies, status codes, HTTPS, and HTTP proxies. It also covers server-side and client-side functionality, sessions, URL encoding, HTML encoding, and serialization frameworks.
Pointer is a variable that stores the memory address of another variable. It allows dynamic memory allocation and access of memory locations. There are three ways to pass arguments to functions in C++ - pass by value, pass by reference, and pass by pointer. Pass by value copies the value, pass by reference copies the address, and pass by pointer passes the address of the argument. Pointers can also point to arrays or strings to access elements. Arrays of pointers can store multiple strings. References are alternative names for existing variables and any changes made using the reference affect the original variable. Functions can return pointers or references.
Pseudocode is an outline of a program written in a way that can be easily converted to a programming language. It uses natural language and programming constructs like expressions, methods, decision structures, loops, and array indexing. The three essential programming constructs are selection (if/else), repetition (while loops), and sequence. Pseudocode also uses relational, logical, and arithmetic operators and follows rules like using meaningful names and indenting code blocks.
This document provides an overview of JavaScript basics including variables, data types, operators, conditional statements, loops, functions, arrays, and error handling. It explains JavaScript syntax, how to include JavaScript code in HTML pages, and commonly used statements like if/else, switch case, while and for loops. It also covers JavaScript functions, returning values from functions, and printing pages. The document describes JavaScript strings and array objects, and their associated methods. Finally, it discusses different types of errors in JavaScript like syntax errors, runtime errors, and logical errors.
PHP is a server-side scripting language used for web development. It allows developers to add dynamic content and functionality to websites. Some key points about PHP from the document:
- PHP code is embedded into HTML and executed on the server to create dynamic web page content. It can be used to connect to databases, process forms, and more.
- PHP has many data types including strings, integers, floats, booleans, arrays, objects, null values and resources. Variables, operators, and conditional statements allow for control flow and data manipulation.
- Common PHP structures include if/else statements for conditional logic, loops like for/while/foreach for iteration, and functions for reusability. Ar
Generics in Java allows the creation of generic classes and methods that can work with different data types. A generic class uses type parameters that appear within angle brackets, allowing the class to work uniformly with different types. Generic methods also use type parameters to specify the type of data upon which the method operates. Bounded type parameters allow restricting the types that can be passed to a type parameter.
JavaScript is a scripting language originally designed for web browsers but now used everywhere. It has dynamic typing and supports object-oriented, imperative, and functional programming. JavaScript was created in 1995 and standardized in 1999. It is now the most popular language on GitHub. JavaScript can be used to build interactive web pages, desktop applications, server-side applications, IoT applications, and real-time applications. The core data types in JavaScript are Number, String, Boolean, Object, Function, Array, Date, and Regular Expressions. JavaScript supports features like variables, flow control, error handling, debugging, and JSON for data exchange.
Selection Statements
Using if and if...else
Nested if Statements
Using switch Statements
Conditional Operator
Repetition Statements
Looping: while, do, and for
Nested loops
Using break and continue
PHP-MySQL Database Connectivity Using XAMPP ServerRajiv Bhatia
This document provides a step-by-step guide for connecting PHP to MySQL using XAMPP server. It describes downloading and installing XAMPP, creating a database and table in MySQL, and writing PHP code to insert data into the MySQL table from an HTML form.
The document summarizes a training presentation on PHP with MySQL. It begins with an introduction to the Center for Electronic Governance (CEG), which was established in 2006 by the Government of Rajasthan to oversee technical education. The presentation then covers the history of PHP, what PHP is, its features, code syntax, components like variables, operators, arrays and functions. It discusses advantages of PHP like being open source and supporting multiple databases. Finally, it provides an overview of why MySQL is a popular database to use with PHP before describing some basic MySQL queries.
This document defines and provides examples of different types of operators in C programming. It discusses arithmetic, relational, logical, assignment, increment/decrement, conditional, bitwise, and special operators. For each type of operator it provides the syntax, example uses, and meaning. It also gives examples to illustrate the differences between prefix and postfix increment/decrement operators.
Cross Site Scripting (XSS) is a vulnerability that allows malicious users to insert client-side code into web pages that is then executed by a user's browser. This code can steal cookies, access private information, perform actions on the user's behalf, and redirect them to malicious websites. XSS works by having the server display input containing malicious JavaScript from a request. There are different types of XSS attacks, including non-persistent, persistent, and DOM-based attacks. Prevention methods include validating, sanitizing, and escaping all user input on the server-side and client-side. Web vulnerability scanners like Burp Suite can help test for XSS and other vulnerabilities.
This document discusses pointers in C++. It defines pointers as variables that store memory addresses of other variables. It covers declaring and initializing pointers, using the address and dereference operators, pointer arithmetic, references, and passing pointers as function arguments. The document includes examples of pointer code and output to demonstrate these concepts.
This document provides an introduction to the Python programming language. It covers Python's history and features, including its syntax, types, operators, control flow, functions, classes, and tools. Python is a readable, dynamic language suitable for web development, GUIs, scripting, and more. It has a focus on readability and productivity. Major companies and organizations that use Python include Google, NASA, Dropbox, IBM, Instagram, and Mozilla.
The document provides an introduction to Python programming. It discusses that Python is a high-level, interpreted, object-oriented, and general purpose programming language. It can be used for web development, scientific computing, desktop applications, and more. The document then covers Python basics like data types, variables, literals, operators, control flow statements, functions, modules and packages. It also discusses installing Python on Windows and writing the first Python program.
Are you using Java8 Lambdas & Streams in your core business logic? Then you might be having this strange feeling that it’s not Java anymore: at times it’s cryptic, barely readable.. This was the topic of the workshop with the same name that I held at VoxxedDays Bucharest 2017. These are the slides backing the that workshop.
As a summary, the materials walk through the functional features of Java8, adding details along the way about how we can keep the code clean as we embrace the Java 8 features.
The entire desktop screencast + voice it's on youtube, here: https://youtu.be/uH9A37k2QkU
The document discusses different types of conditional and control statements in Python including if, if-else, elif, nested if-else, while, for loops, and else with loops.
It provides the syntax and examples of each statement type. The if statement and if-else statement are used for simple decision making. The elif statement allows for chained conditional execution with more than two possibilities. Nested if-else allows if/elif/else statements within other conditionals. While and for loops are used to repeatedly execute blocks of code, with while looping until a condition is false and for looping over sequences. The else statement with loops executes code when the loop condition is false.
This document discusses connecting to and interacting with MySQL databases from PHP. It covers connecting to a MySQL database server, selecting databases, executing SQL statements, working with query results, and inserting, updating and deleting records. Functions covered include mysql_connect(), mysql_query(), mysql_fetch_row(), mysql_affected_rows(), and mysql_info(). The document provides examples of connecting to MySQL, selecting databases, executing queries, and accessing and manipulating data.
Rasmus Lerdorf is known as the father of PHP. $name is a variable while $$name is a reference variable that references the value of the variable named in $name. We can submit a form without a submit button by using the JavaScript submit() function to call document.formname.submit() on click. There are 4 ways to retrieve data from a MySQL result set using PHP: mysql_fetch_row, mysql_fetch_array, mysql_fetch_object, and mysql_fetch_assoc.
This document contains a practice exam with 18 multiple choice questions about PHP functions and concepts. It is registered to Núria Torrescasana of Manresa, Barcelona, Spain. The questions cover topics like PHP functions, arrays, classes, sessions, strings, dates/time, and file handling. The answers to the questions are provided at the end.
The document provides an overview of key concepts related to web application technologies including the HTTP protocol, web functionality, and encoding schemes. It discusses HTTP requests and responses, common HTTP methods like GET and POST, URLs, REST, HTTP headers, cookies, status codes, HTTPS, and HTTP proxies. It also covers server-side and client-side functionality, sessions, URL encoding, HTML encoding, and serialization frameworks.
Pointer is a variable that stores the memory address of another variable. It allows dynamic memory allocation and access of memory locations. There are three ways to pass arguments to functions in C++ - pass by value, pass by reference, and pass by pointer. Pass by value copies the value, pass by reference copies the address, and pass by pointer passes the address of the argument. Pointers can also point to arrays or strings to access elements. Arrays of pointers can store multiple strings. References are alternative names for existing variables and any changes made using the reference affect the original variable. Functions can return pointers or references.
Pseudocode is an outline of a program written in a way that can be easily converted to a programming language. It uses natural language and programming constructs like expressions, methods, decision structures, loops, and array indexing. The three essential programming constructs are selection (if/else), repetition (while loops), and sequence. Pseudocode also uses relational, logical, and arithmetic operators and follows rules like using meaningful names and indenting code blocks.
This document provides an overview of JavaScript basics including variables, data types, operators, conditional statements, loops, functions, arrays, and error handling. It explains JavaScript syntax, how to include JavaScript code in HTML pages, and commonly used statements like if/else, switch case, while and for loops. It also covers JavaScript functions, returning values from functions, and printing pages. The document describes JavaScript strings and array objects, and their associated methods. Finally, it discusses different types of errors in JavaScript like syntax errors, runtime errors, and logical errors.
PHP is a server-side scripting language used for web development. It allows developers to add dynamic content and functionality to websites. Some key points about PHP from the document:
- PHP code is embedded into HTML and executed on the server to create dynamic web page content. It can be used to connect to databases, process forms, and more.
- PHP has many data types including strings, integers, floats, booleans, arrays, objects, null values and resources. Variables, operators, and conditional statements allow for control flow and data manipulation.
- Common PHP structures include if/else statements for conditional logic, loops like for/while/foreach for iteration, and functions for reusability. Ar
Generics in Java allows the creation of generic classes and methods that can work with different data types. A generic class uses type parameters that appear within angle brackets, allowing the class to work uniformly with different types. Generic methods also use type parameters to specify the type of data upon which the method operates. Bounded type parameters allow restricting the types that can be passed to a type parameter.
JavaScript is a scripting language originally designed for web browsers but now used everywhere. It has dynamic typing and supports object-oriented, imperative, and functional programming. JavaScript was created in 1995 and standardized in 1999. It is now the most popular language on GitHub. JavaScript can be used to build interactive web pages, desktop applications, server-side applications, IoT applications, and real-time applications. The core data types in JavaScript are Number, String, Boolean, Object, Function, Array, Date, and Regular Expressions. JavaScript supports features like variables, flow control, error handling, debugging, and JSON for data exchange.
Selection Statements
Using if and if...else
Nested if Statements
Using switch Statements
Conditional Operator
Repetition Statements
Looping: while, do, and for
Nested loops
Using break and continue
PHP-MySQL Database Connectivity Using XAMPP ServerRajiv Bhatia
This document provides a step-by-step guide for connecting PHP to MySQL using XAMPP server. It describes downloading and installing XAMPP, creating a database and table in MySQL, and writing PHP code to insert data into the MySQL table from an HTML form.
The document summarizes a training presentation on PHP with MySQL. It begins with an introduction to the Center for Electronic Governance (CEG), which was established in 2006 by the Government of Rajasthan to oversee technical education. The presentation then covers the history of PHP, what PHP is, its features, code syntax, components like variables, operators, arrays and functions. It discusses advantages of PHP like being open source and supporting multiple databases. Finally, it provides an overview of why MySQL is a popular database to use with PHP before describing some basic MySQL queries.
This document defines and provides examples of different types of operators in C programming. It discusses arithmetic, relational, logical, assignment, increment/decrement, conditional, bitwise, and special operators. For each type of operator it provides the syntax, example uses, and meaning. It also gives examples to illustrate the differences between prefix and postfix increment/decrement operators.
Cross Site Scripting (XSS) is a vulnerability that allows malicious users to insert client-side code into web pages that is then executed by a user's browser. This code can steal cookies, access private information, perform actions on the user's behalf, and redirect them to malicious websites. XSS works by having the server display input containing malicious JavaScript from a request. There are different types of XSS attacks, including non-persistent, persistent, and DOM-based attacks. Prevention methods include validating, sanitizing, and escaping all user input on the server-side and client-side. Web vulnerability scanners like Burp Suite can help test for XSS and other vulnerabilities.
This document discusses pointers in C++. It defines pointers as variables that store memory addresses of other variables. It covers declaring and initializing pointers, using the address and dereference operators, pointer arithmetic, references, and passing pointers as function arguments. The document includes examples of pointer code and output to demonstrate these concepts.
This document provides an introduction to the Python programming language. It covers Python's history and features, including its syntax, types, operators, control flow, functions, classes, and tools. Python is a readable, dynamic language suitable for web development, GUIs, scripting, and more. It has a focus on readability and productivity. Major companies and organizations that use Python include Google, NASA, Dropbox, IBM, Instagram, and Mozilla.
The document provides an introduction to Python programming. It discusses that Python is a high-level, interpreted, object-oriented, and general purpose programming language. It can be used for web development, scientific computing, desktop applications, and more. The document then covers Python basics like data types, variables, literals, operators, control flow statements, functions, modules and packages. It also discusses installing Python on Windows and writing the first Python program.
Are you using Java8 Lambdas & Streams in your core business logic? Then you might be having this strange feeling that it’s not Java anymore: at times it’s cryptic, barely readable.. This was the topic of the workshop with the same name that I held at VoxxedDays Bucharest 2017. These are the slides backing the that workshop.
As a summary, the materials walk through the functional features of Java8, adding details along the way about how we can keep the code clean as we embrace the Java 8 features.
The entire desktop screencast + voice it's on youtube, here: https://youtu.be/uH9A37k2QkU
The document discusses different types of conditional and control statements in Python including if, if-else, elif, nested if-else, while, for loops, and else with loops.
It provides the syntax and examples of each statement type. The if statement and if-else statement are used for simple decision making. The elif statement allows for chained conditional execution with more than two possibilities. Nested if-else allows if/elif/else statements within other conditionals. While and for loops are used to repeatedly execute blocks of code, with while looping until a condition is false and for looping over sequences. The else statement with loops executes code when the loop condition is false.
This document discusses connecting to and interacting with MySQL databases from PHP. It covers connecting to a MySQL database server, selecting databases, executing SQL statements, working with query results, and inserting, updating and deleting records. Functions covered include mysql_connect(), mysql_query(), mysql_fetch_row(), mysql_affected_rows(), and mysql_info(). The document provides examples of connecting to MySQL, selecting databases, executing queries, and accessing and manipulating data.
Rasmus Lerdorf is known as the father of PHP. $name is a variable while $$name is a reference variable that references the value of the variable named in $name. We can submit a form without a submit button by using the JavaScript submit() function to call document.formname.submit() on click. There are 4 ways to retrieve data from a MySQL result set using PHP: mysql_fetch_row, mysql_fetch_array, mysql_fetch_object, and mysql_fetch_assoc.
This document contains a practice exam with 18 multiple choice questions about PHP functions and concepts. It is registered to Núria Torrescasana of Manresa, Barcelona, Spain. The questions cover topics like PHP functions, arrays, classes, sessions, strings, dates/time, and file handling. The answers to the questions are provided at the end.
This document contains questions about various PHP topics, including:
- Disabling error messages in HTML output
- Returning other file formats like Word and Excel from PHP
- Forcing PHP garbage collection before the end of a request
- Including files in a loop that only includes the first file
- Calling C libraries from PHP scripts
- Starting a PHP program
- Passing variables between included files
- Inserting output from a CGI script into an included file
- Reading and outputting content from a text file in a table
- Adding authentication to a PHP site
This document provides tips from various PHP developers on what to expect and focus on in PHP interviews. It then lists 26 PHP interview questions and provides additional exercises and concepts for candidates to brush up on to prepare for interviews. The questions cover a wide range of PHP topics from syntax and functions to object oriented programming concepts, security practices, and frameworks.
The document provides answers to 40 questions about PHP. It discusses topics like what PHP is, sessions, PEAR, cookies, error handling, object-oriented programming concepts in PHP, and how to interact with databases and send/receive data through GET and POST requests. Each question is followed by a short 1-3 sentence answer providing the key information about the topic. The document serves as a reference for common PHP questions and their essential answers.
This document provides descriptions and examples of useful functions for manipulating arrays in PHP. It lists functions for getting array size, values and keys; adding, removing, and sorting elements; merging, reversing, and randomizing arrays; searching arrays; slicing arrays; removing duplicate values; and applying functions to array elements.
Enrico Zimuel and Carlos Buenosvinos administered a 40 question PHP 5.3 certification practice exam over 40 minutes. The exam covered various PHP questions and functions. Upon completion, participants received feedback on their results and encouragement to try the real certification exam.
MVC stands for Model-View-Controller. The MVC pattern separates an application into three parts: the model, the view, and the controller. The model handles the application's data logic, the view handles presentation logic, and the controller handles business logic and communication between the model and view. MVC is commonly used in PHP frameworks like CodeIgniter to separate an application's logical components.
The document describes how to create cascading dropdown lists for country, state, and city using PHP and Ajax. It involves:
1. Creating country, state, and city tables in a MySQL database to store the options.
2. Creating PHP files - config.php to connect to the database, index.php to display the dropdowns, and load_state_city.php to populate the state and city dropdowns using Ajax calls based on the country and state selected.
3. Using JavaScript/jQuery to make Ajax calls and populate the state and city dropdowns dynamically based on the country and state selected in the previous dropdown.
When run, index.php displays casc
This document contains sample questions for the Zend Certification PHP 5 exam. It includes multiple choice questions testing PHP 5 language features and best practices related to topics like XML processing, database access, regular expressions, and security. The questions cover syntax, functions, patterns and other PHP concepts that could appear on the certification exam.
The document describes how to create a CodeIgniter PHP application for adding, editing, and deleting records in a database table. It includes creating the database and table, a controller and model to perform CRUD operations, and views to display and edit data. The controller functions handle getting all records, adding, updating, and deleting via the model. The views display all records in a table and include edit/delete links, and a form to add/edit individual records by calling the appropriate controller functions.
This document contains questions and answers related to .NET interview questions asked by Vineet Kumar Saini. It includes questions on SQL queries, ASP.NET controls and properties, OOPs concepts, threading, Ajax and more. The questions range from basic to advanced levels covering key areas of .NET such as C#, VB.NET, ASP.NET and ADO.NET.
What are the top 100 SQL Interview Questions and Answers in 2014? Based on the most popular SQL questions asked in interview, we've compiled a list of the 100 most popular SQL interview questions in 2014.
This pdf includes oracle sql interview questions and answers, sql query interview questions and answers, sql interview questions and answers for freshers etc and is perfect for those who're appearing for a linux interview in top IT companies like HCL, Infosys, TCS, Wipro, Tech Mahindra, Cognizant etc
This list includes SQL interview questions in the below categories:
top 100 sql interview questions and answers
top 100 java interview questions and answers
top 100 c interview questions and answers
top 50 sql interview questions and answers
top 100 interview questions and answers book
sql interview questions and answers pdf
oracle sql interview questions and answers
sql query interview questions and answers
sql interview questions and answers for freshers
SQL Queries Interview Questions and Answers
SQL Interview Questions and Answers
Top 80 + SQL Query Interview Questions and Answers
Top 20 SQL Interview Questions with Answers
Sql Server Interviews Questions and Answers
100 Mysql interview questions and answers
SQL Queries Interview Questions
SQL Query Interview Questions and Answers with Examples
Mysql interview questions and answers for freshers and experienced
PHP is a loosely typed scripting language commonly used for web development. It was created by Rasmus Lerdorf in 1995 and has evolved through several versions. PHP code is interpreted at runtime and allows for features like conditionals, loops, functions, classes, and objects to build dynamic web applications.
PHP is a server-side scripting language used to create dynamic web pages. It allows embedding PHP code within HTML pages and interacting with databases. Key elements of PHP include variables, control structures, functions, and sessions. Sessions store user data on the server instead of the client to avoid cookies and allow tracking users across multiple pages.
The user is receiving an error when trying to create a table from a select statement on another table due to invalid dates. Exporting the data to insert statements and inserting into an empty table did not resolve the issue. It is recommended to use TOAD to export the data as insert statements to identify any records that cannot be inserted into the empty table to find the source of the invalid dates.
Static dropdown lists display hardcoded options while dynamic dropdown lists populate options from a database. A static list example shows employee names hardcoded in HTML. Dynamic lists connect to a MySQL database with an employee table. Code retrieves employee names from the table and displays them as selectable options, allowing selection of a live database record rather than a static value. Dynamic lists offer more flexibility but require database interaction code compared to simple static lists.
There are three types of CSS style sheets that can be used to style HTML: inline, internal, and external. Inline style sheets apply styles directly in the HTML tags, internal style sheets use <style> tags in the head, and external style sheets link to a separate .css file. CSS allows for control over fonts, sizes, colors, spacing and more to format HTML pages.
This document discusses how to determine browser information in PHP. It lists several common browsers like Firefox, Safari, Opera, and Internet Explorer. It then provides code to output the name of the browser being used by checking the user agent string. The code sample shown returns "Internet Explorer" when viewed using IE. It also demonstrates how to output the visitor's IP address using the PHP $_SERVER['REMOTE_ADDR'] variable.
This document discusses using the LIMIT operator in SQL queries executed from PHP code. The LIMIT operator allows restricting the number of rows returned from a database query. The example shows connecting to a database, running a SELECT query with LIMIT 0,5 to retrieve the first 5 rows, and outputting the results in an HTML table. Using LIMIT in PHP queries provides a way to page through large result sets by controlling the number of rows fetched.
The document contains 54 questions and answers related to PHP. It covers topics such as PHP syntax, variables, arrays, forms, files, dates, and more. Some key points:
- PHP is a server-side scripting language typically used for web development. It allows embedding scripting code into HTML documents.
- PHP is a loosely typed language that automatically converts variables to the correct data type. Variables start with '$' and are case-sensitive.
- Common PHP functions include echo, print, include, isset, empty, count, array, strtotime, and more for output, files, arrays, dates, and other tasks.
- PHP can interface with databases like MySQL and
This document provides instructions for Lab 4 of an information systems design course. The lab aims to build experience with fundamental PHP functions related to arrays, strings, and regular expressions. Students will modify PHP code snippets to work with multi-dimensional arrays, define and call functions, and perform string operations like searching and replacing text. The lab consists of 4 steps involving PHP code to demonstrate various PHP features and concepts.
This document provides instructions for Lab 4 of an information systems design course. The lab aims to build experience with fundamental PHP functions related to arrays, strings, and regular expressions. Students will modify PHP code snippets to work with multi-dimensional arrays, define and call functions, and perform string operations like searching and replacing text. The lab consists of 4 steps involving PHP code to demonstrate various language features like joining strings, defining functions, and using regular expressions.
This document provides an overview of PHP including:
- Basic PHP syntax like variables, data types, operators, and control structures
- Functions - both built-in and user-defined, including arguments and return values
- Loops - while, do-while, for, foreach
- Object-oriented concepts like classes, objects, constructors, inheritance
- Arrays - indexed, associative, and multidimensional
- Strings and math functions
- An introduction to abstraction and object-oriented programming principles in PHP
The document contains a list of 37 PHP interview questions and their answers. Some of the key questions covered include: how to find the number of days between two dates in PHP, how to define a constant, the difference between urlencode and urldecode, how to get uploaded file information, the difference between mysql_fetch_object and mysql_fetch_array, how to pass a variable by reference, how to submit a form without a submit button, how to extract a string from another string using a regular expression, and how to get browser properties using PHP.
PHP is a server-side scripting language that can be embedded into HTML. It is used to dynamically generate client-side code sent as the HTTP response. PHP code is executed on the web server and allows variables, conditional statements, loops, functions, and arrays to dynamically output content. Key features include PHP tags <?php ?> to delimit PHP code, the echo command to output to the client, and variables that can store different data types and change types throughout a program.
PHP is a server-side scripting language that can be embedded into HTML. It is used to dynamically generate client-side code sent as the HTTP response. PHP code is executed on the web server and allows variables, conditional statements, loops, functions, and arrays to dynamically output content. Key features include PHP tags <?php ?> to delimit PHP code, the echo command to output to the client, and variables that can store different data types and change types throughout a program.
This document contains a summary of 14 multiple choice questions related to arrays and built-in functions in PHP. The questions cover topics like defining functions, numerically indexed arrays, calling functions, magic functions, multidimensional arrays, and array sorting functions. Each question is followed by an explanation of the answer. The questions assess understanding of core PHP concepts like functions, arrays, and built-in functions.
This document provides an overview of PHP (Hypertext Preprocessor), a popular server-side scripting language used for web development. It discusses key PHP concepts like server-side scripting, inclusion of files, syntax, variables, arrays, operators, functions, branching, looping, forms, MySQL integration, sessions, and cookies. The document is intended to help beginners get started with PHP.
PHP is a server-side scripting language that is embedded into HTML files. The goal is to generate client-side code like HTML, CSS, and JavaScript. PHP files are executed on the web server and must be saved in a subdirectory that is accessible to the server, like /var/www. PHP allows variables, operators, conditional statements, loops, functions, and arrays. Sessions and cookies can be used to store and retrieve information across multiple requests.
Preparing for the next PHP version (5.6)Damien Seguy
With versions stretching from 5.3 to 5.6, PHP has several major published versions, that require special attention when migrating. Beyond checking for compilation, the code must be reviewed to avoid pitfalls like obsoletes functions, new features, change in default parameters or behavior. We'll set up a checklist of such traps, and ways to find them in the code and be reading for PHP 5.6.
The document discusses building testable PHP applications. It covers topics like testing code, testable architecture, dependency injection, and static code analysis tools like PHP Code Sniffer, PHP Mess Detector, and PHP Copy Paster Detector. The document emphasizes that writing tests and designing for testability leads to fewer bugs and more maintainable code. It provides examples of unit testing and recommends test-driven development practices.
This document contains questions and answers about PHP. It discusses PHP variable names, data types, functions like include(), require(), echo and print, arrays, object oriented concepts like inheritance and constants. It also covers regular expressions, error handling, strings, files and directories.
Can't Miss Features of PHP 5.3 and 5.4Jeff Carouth
If you're like me you remember the days of PHP3 and PHP4; you remember when PHP5 was released, and how it was touted to change to your life. It's still changing and there are some features of PHP 5.3 and new ones coming with PHP 5.4 that will improve your code readability and reusability. Let's look at some touted features such as closures, namespaces, and traits, as well as some features being discussed for future releases.
This document provides information about PHP (Hypertext Preprocessor), which is a server-side scripting language used for web development. It discusses that PHP scripts are executed on the server, PHP supports many databases, and it is an open source software. The document also explains why PHP is used, where to start with PHP, basic PHP syntax, variables, operators, conditional statements, loops, arrays, functions, forms, connecting to databases, and creating databases and tables. It provides examples of PHP code for many of these concepts to demonstrate how PHP works.
This document summarizes new features in PHP 5.3, 5.4, and 5.5. It discusses features like namespaces, closures, late static bindings, traits, short array syntax, and more. The document is intended to introduce PHP updates and help software engineers stay up to date on PHP features.
Technology Trends in 2025: AI and Big Data AnalyticsInData Labs
At InData Labs, we have been keeping an ear to the ground, looking out for AI-enabled digital transformation trends coming our way in 2025. Our report will provide a look into the technology landscape of the future, including:
-Artificial Intelligence Market Overview
-Strategies for AI Adoption in 2025
-Anticipated drivers of AI adoption and transformative technologies
-Benefits of AI and Big data for your business
-Tips on how to prepare your business for innovation
-AI and data privacy: Strategies for securing data privacy in AI models, etc.
Download your free copy nowand implement the key findings to improve your business.
Dev Dives: Automate and orchestrate your processes with UiPath MaestroUiPathCommunity
This session is designed to equip developers with the skills needed to build mission-critical, end-to-end processes that seamlessly orchestrate agents, people, and robots.
📕 Here's what you can expect:
- Modeling: Build end-to-end processes using BPMN.
- Implementing: Integrate agentic tasks, RPA, APIs, and advanced decisioning into processes.
- Operating: Control process instances with rewind, replay, pause, and stop functions.
- Monitoring: Use dashboards and embedded analytics for real-time insights into process instances.
This webinar is a must-attend for developers looking to enhance their agentic automation skills and orchestrate robust, mission-critical processes.
👨🏫 Speaker:
Andrei Vintila, Principal Product Manager @UiPath
This session streamed live on April 29, 2025, 16:00 CET.
Check out all our upcoming Dev Dives sessions at https://community.uipath.com/dev-dives-automation-developer-2025/.
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungenpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-nomad-web-best-practices-und-verwaltung-von-multiuser-umgebungen/
HCL Nomad Web wird als die nächste Generation des HCL Notes-Clients gefeiert und bietet zahlreiche Vorteile, wie die Beseitigung des Bedarfs an Paketierung, Verteilung und Installation. Nomad Web-Client-Updates werden “automatisch” im Hintergrund installiert, was den administrativen Aufwand im Vergleich zu traditionellen HCL Notes-Clients erheblich reduziert. Allerdings stellt die Fehlerbehebung in Nomad Web im Vergleich zum Notes-Client einzigartige Herausforderungen dar.
Begleiten Sie Christoph und Marc, während sie demonstrieren, wie der Fehlerbehebungsprozess in HCL Nomad Web vereinfacht werden kann, um eine reibungslose und effiziente Benutzererfahrung zu gewährleisten.
In diesem Webinar werden wir effektive Strategien zur Diagnose und Lösung häufiger Probleme in HCL Nomad Web untersuchen, einschließlich
- Zugriff auf die Konsole
- Auffinden und Interpretieren von Protokolldateien
- Zugriff auf den Datenordner im Cache des Browsers (unter Verwendung von OPFS)
- Verständnis der Unterschiede zwischen Einzel- und Mehrbenutzerszenarien
- Nutzung der Client Clocking-Funktion
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfAbi john
Analyze the growth of meme coins from mere online jokes to potential assets in the digital economy. Explore the community, culture, and utility as they elevate themselves to a new era in cryptocurrency.
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxJustin Reock
Building 10x Organizations with Modern Productivity Metrics
10x developers may be a myth, but 10x organizations are very real, as proven by the influential study performed in the 1980s, ‘The Coding War Games.’
Right now, here in early 2025, we seem to be experiencing YAPP (Yet Another Productivity Philosophy), and that philosophy is converging on developer experience. It seems that with every new method we invent for the delivery of products, whether physical or virtual, we reinvent productivity philosophies to go alongside them.
But which of these approaches actually work? DORA? SPACE? DevEx? What should we invest in and create urgency behind today, so that we don’t find ourselves having the same discussion again in a decade?
Spark is a powerhouse for large datasets, but when it comes to smaller data workloads, its overhead can sometimes slow things down. What if you could achieve high performance and efficiency without the need for Spark?
At S&P Global Commodity Insights, having a complete view of global energy and commodities markets enables customers to make data-driven decisions with confidence and create long-term, sustainable value. 🌍
Explore delta-rs + CDC and how these open-source innovations power lightweight, high-performance data applications beyond Spark! 🚀
Big Data Analytics Quick Research Guide by Arthur MorganArthur Morgan
This is a Quick Research Guide (QRG).
QRGs include the following:
- A brief, high-level overview of the QRG topic.
- A milestone timeline for the QRG topic.
- Links to various free online resource materials to provide a deeper dive into the QRG topic.
- Conclusion and a recommendation for at least two books available in the SJPL system on the QRG topic.
QRGs planned for the series:
- Artificial Intelligence QRG
- Quantum Computing QRG
- Big Data Analytics QRG
- Spacecraft Guidance, Navigation & Control QRG (coming 2026)
- UK Home Computing & The Birth of ARM QRG (coming 2027)
Any questions or comments?
- Please contact Arthur Morgan at [email protected].
100% human made.
TrsLabs - Fintech Product & Business ConsultingTrs Labs
Hybrid Growth Mandate Model with TrsLabs
Strategic Investments, Inorganic Growth, Business Model Pivoting are critical activities that business don't do/change everyday. In cases like this, it may benefit your business to choose a temporary external consultant.
An unbiased plan driven by clearcut deliverables, market dynamics and without the influence of your internal office equations empower business leaders to make right choices.
Getting things done within a budget within a timeframe is key to Growing Business - No matter whether you are a start-up or a big company
Talk to us & Unlock the competitive advantage
This is the keynote of the Into the Box conference, highlighting the release of the BoxLang JVM language, its key enhancements, and its vision for the future.
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell
With expertise in data architecture, performance tracking, and revenue forecasting, Andrew Marnell plays a vital role in aligning business strategies with data insights. Andrew Marnell’s ability to lead cross-functional teams ensures businesses achieve sustainable growth and operational excellence.
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersToradex
Toradex brings robust Linux support to SMARC (Smart Mobility Architecture), ensuring high performance and long-term reliability for embedded applications. Here’s how:
• Optimized Torizon OS & Yocto Support – Toradex provides Torizon OS, a Debian-based easy-to-use platform, and Yocto BSPs for customized Linux images on SMARC modules.
• Seamless Integration with i.MX 8M Plus and i.MX 95 – Toradex SMARC solutions leverage NXP’s i.MX 8 M Plus and i.MX 95 SoCs, delivering power efficiency and AI-ready performance.
• Secure and Reliable – With Secure Boot, over-the-air (OTA) updates, and LTS kernel support, Toradex ensures industrial-grade security and longevity.
• Containerized Workflows for AI & IoT – Support for Docker, ROS, and real-time Linux enables scalable AI, ML, and IoT applications.
• Strong Ecosystem & Developer Support – Toradex offers comprehensive documentation, developer tools, and dedicated support, accelerating time-to-market.
With Toradex’s Linux support for SMARC, developers get a scalable, secure, and high-performance solution for industrial, medical, and AI-driven applications.
Do you have a specific project or application in mind where you're considering SMARC? We can help with Free Compatibility Check and help you with quick time-to-market
For more information: https://www.toradex.com/computer-on-modules/smarc-arm-family
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Impelsys Inc.
Impelsys provided a robust testing solution, leveraging a risk-based and requirement-mapped approach to validate ICU Connect and CritiXpert. A well-defined test suite was developed to assess data communication, clinical data collection, transformation, and visualization across integrated devices.
Generative Artificial Intelligence (GenAI) in BusinessDr. Tathagat Varma
My talk for the Indian School of Business (ISB) Emerging Leaders Program Cohort 9. In this talk, I discussed key issues around adoption of GenAI in business - benefits, opportunities and limitations. I also discussed how my research on Theory of Cognitive Chasms helps address some of these issues
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxshyamraj55
We’re bringing the TDX energy to our community with 2 power-packed sessions:
🛠️ Workshop: MuleSoft for Agentforce
Explore the new version of our hands-on workshop featuring the latest Topic Center and API Catalog updates.
📄 Talk: Power Up Document Processing
Dive into smart automation with MuleSoft IDP, NLP, and Einstein AI for intelligent document workflows.
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxshyamraj55
PHP Technical Questions
1. 1. What does the following code return?
$arr = array(1,3,5);
$count = count($arr);
if ($count = 0) {
echo "An array is empty.";
} else {
echo "An array has $count elements.";
}
1. An array has 3 elements.
2. An array consists of 0 elements.
3. An array is empty.
Answer: 2
2.What is the result of the following code?
$a = 10;
if($a > 5 OR < 15)
echo "true";
else
echo "false";
1. true
2. false
3. There is a syntax error will display.
4. Nothing will be displayed.
Answer: 3
3. Which of the statements is not true of the interfaces?
1. A class can implement multiple interfaces.
2. Methods with the same names and arguments can exist in multiple interfaces, this class
implements.
3. An abstract class can implement multiple interfaces.
4. The interface itself can extend multiple interfaces.
Answer: 2
4. If you want to pass the argument of the function by reference, the correct path would be:
1. function ModifyReport(&$Rptfile){}
2. function ModifyReport($Rptfile){}
3. function ModifyReport(ByRef $Rptfile){}
4. function ModifyReport(&Rptfile){}
Answer: 1
5.Which of the following pairs of operators are not opposite?
1. +, -
2. &=, |=
3. ==, !=
4. <<, >>
Answer: 2
1|Page Pankaj Kumar Jha (www.globaljournals.org)
2. 6. Which of the following casts are not true?
<?php
$fig = 23;
$varbl = (real) $fig;
$varb2 = (double) $fig;
$varb3 = (decimal) $fig;
$varb4 = (bool) $fig;
?>
1. real
2. double
3. decimal
4. boolean
Answer: 3
7. Choose false statement about abstract classes in PHP5.
1. Abstract classes are introduced in PHP5.
2. An abstract method's definition may contain method body.
3. Class with at least one abstract method must be declared as abstract.
4. An abstract class may contain non-abstract methods.
Answer: 2
8. Which of the following functions returns the longest hash value?
1. sha1()
2. md5()
3. crc32()
4. All these functions return the same hash value.
Answer: 1
9. Which of these characters can be processed by the htmlspecialchars() function?
1. ' - single quote
2. '' - double quote
3. < - less than
4. > - greater than
5. & - an ampersand
6. All
Answer: 6
10. Choose all valid PHP5 data types.
1. money
2. varchar
3. float
4. char
5. complex
Answer: 3
2|Page Pankaj Kumar Jha (www.globaljournals.org)
3. 11. How many parameters can be passed to this function?
<?
function f() {
...
}
?>
1. 0 (zero)
2. 1 (one)
3. that amount determined by the php configuration.
4. any number of params.
Answer: 4
12. What gets printed?
<?php
$var = 'false';
if ($var) {
echo 'true';
} else {
echo 'false';
}
?>
Answer: true [This is a string literal, which converts to Boolean true ]
13. Which of the following is used to declare a constant
1. const
2. constant
3. define
4. #pragma
5. Def
Answer: 3
Here is an example of declaring and using a constant:
define(PI, 3.14);
printf("PI = %.2fn", PI);
14. What will be printed?
<?php
$var = '0';
if ($var) {
echo 'true';
} else {
echo 'false';
}
?>
Answer: false
3|Page Pankaj Kumar Jha (www.globaljournals.org)
4. 15. What will be the value of $var?
<?php $var = 1 / 2; ?>
1. 0
2. 0.5
3. 1
Answer:2
16. How do we access the value of 'd' later?
$a = array( 'a', 3 => 'b', 1 => 'c', 'd' );
1. $a[0]
2. $a[1]
3. $a[2]
4. $a[3]
5. $a[4]
Answer: 5
17. Which of the following is NOT a magic predefined constant?
1. __LINE__
2. __FILE__
3. __DATE__
4. __CLASS__
5. __METHOD__
Answer: 3
18. What will be printed?
$a = array();
if ($a == null) {
echo 'true';
} else {
echo 'false';
}
Answer: true[empty array converts to null ]
19. What will be printed?
if (null === false) {
echo 'true';
} else {
echo 'false';
}
Answer: false
=== is true if values are equal and of the same type, false is of the boolean type, but null is of the special null type
4|Page Pankaj Kumar Jha (www.globaljournals.org)
5. 20. What gets printed?
<?php
$RESULT = 11 + 011 + 0x11;
echo "$RESULT";
?>
1. 11
2. 22
3. 33
4. 37
5. 39
Answer: 4 [A decimal plus an octal plus a hex number. 11 + 9 + 17 = 37 ]
21. What will be the value of $var below?
$var = true ? '1' : false ? '2' : '3';
1. 1
2. 2
3. 3
Answer: 2[ternary expressions are evaluated from left to right]
22. What will be printed?
if ('2' == '02') {
echo 'true';
} else {
echo 'false';
}
Answer: true [Numerical strings are compared as integers]
23. Which of the following is NOT a valid PHP comparison operator?
1. !=
2. >=
3. <=>
4. <>
5. ===
6.
Answer:3
24. What will be printed?
$var = 'a';
$VAR = 'b';
echo "$var$VAR";
1. aa
2. bb
3. ab
Answer: 3[Variable names are case-sensitive]
5|Page Pankaj Kumar Jha (www.globaljournals.org)
6. 25. What will be printed?
$a = array( null => 'a', true => 'b', false => 'c', 0 => 'd', 1 => 'e', '' => 'f');
echo count($a), "n";
1. 2
2. 3
3. 4
4. 5
5. 6
Answer: 2[Keys will be converted like this: null to '' (empty string), true to 1, false to 0 ]
26. What gets printed?
class MyException extends Exception {}
try {
throw new MyException('Oops!');
} catch (Exception $e) {
echo "Caught Exceptionn";
} catch (MyException $e) {
echo "Caught MyExceptionn";
}
Answer: Caught Exception [The first catch will match because MyException is a subclass of Exception, so the
second catch is unreachable ]
27. What will be printed?
$a = array();
if ($a[1]) null;
echo count($a), "n";
1. 0
2. 1
3. 2
4. this code won't work
Answer: 1[checking value in if() does not create an array element ]
28. What will be printed by the below code?
$a = 1;
{
$a = 2;
}
echo $a, "n";
Answer: 2 [PHP variables only have a single scope (except in functions) ]
6|Page Pankaj Kumar Jha (www.globaljournals.org)
7. 29. What gets printed?
<?php
$str = 'abn';
echo $str;
?>
1. ab(newline)
2. ab(newline)
3. abn
4. ab(newline)
5. abn
Answer: 3 [ is a special case in single-quoted string literals, which gives a single , n is not interpolated in single-
quoted string literals ]
30. Which statement about the code below is correct?
class A {}
class B {}
class C extends A, B {}
1. the code is perfectly fine
2. classes can not be empty
3. class C can not extend both A and B
4. qualifiers 'public' or 'private' are missing in class definitions
Answer: 3 [A class can only inherit one base class ]
31. What gets printed?
<?php
$x=array("aaa","ttt","www","ttt","yyy","tttt");
$y=array_count_values($x);
echo $y[ttt];
?>
a)2
b)3
c)1
d)4
Answer: a
eg:
<?php
$array = array(1, "hello", 1, "world", "hello");
print_r(array_count_values($array));
?>
After execution of above script we will get output:
Array
7|Page Pankaj Kumar Jha (www.globaljournals.org)
8. (
[1] => 2 //1 came two times in array
[hello] => 2 //Hello came two times in array
[world] => 1
)
32. What's the best way to copy a file from within a piece of PHP?
1. Print out a message asking your user to "telnet" in to the server and copy the file for you
2. Open the input and output files, and use read() and write() to copy the data block by
block until read() returns a zero
3. Use the built in copy() function
4. Use "exec" to run an operating system command such as cp (Unix, Linux) or copy
(Windows)
Answer: 3
33. In php Which method is used to getting browser properties?
1. $_SERVER['HTTP_USER_AGENT'];
2. $_SERVER['PHP_SELF']
3. $_SERVER['SERVER_NAME']
4. $_SERVER['HTTP_VARIENT']
Answer: 1
34. Assume that your php file 'index.php' in location c:/apache/htdocs/phptutor/index.php. If you
used $_SERVER['PHP_SELF'] function in your page, then what is the return value of this
function ?
1. phptutor/index.php
2. /phptutor/index.php
3. c:/apache/htdocs/phptutor/index.php
4. index.php
Answer: 2
35. What will be the ouput of below code ?
Assume that today is 2009-5-19:2:45:32 pm
<?php
$today = date("F j, Y, g:i a");
?>
1. May 19,09,2:45:32 PM
2. May 19, 2009, 2:45 pm
3. May 19,2009,14:45:32 pm
4. May 19,2009,14:45:32 PM
8|Page Pankaj Kumar Jha (www.globaljournals.org)
9. Answer: 2
36. What function used to print statement in PHP?
1. echo();
2. printf
3. "
Answer: 1
37. <?php
define("x","5");
$x=x+10;
echo x;
?>
1. Error
2. 15
3. 10
4. 5
Answer: 4
38. PHP variables are
1. Multitype variables
2. Double type variables
3. Single type variable
4. Trible type variables
Answer: 1
39. Which of these statements is true?
1. PHP interfaces to the MySQL database,and you should transfer any data in Oracle or
Sybase to MySQL if you want to use PHP on the data.
2. PHP interfaces to a number of relational databases such as MySQL, Oracle and
Sybase. A wrapper layer is provided so that code written for one database can easily be
transferred to another if you later switch your database engine.
3. PHP interfaces to a number of relational databases such as MySQL, Oracle and Sybase
but the interface differs in each case.
4. There's little code in PHP to help you interface to databases, but there's no reason why
you can't write such code if you want to.
Answer: 3
40. Which of the following is used to check if a function has already been defined?
1. bool function_exists(functionname)
2. bool f_exists(functionname)
3. bool func_exist(functioname)
Answer: 1
9|Page Pankaj Kumar Jha (www.globaljournals.org)
10. 41. Assume that your php file 'index.php' in location c:/apache/htdocs/phptutor/index.php. If you
used basename($_SERVER['PHP_SELF']) function in your page, then what is the return value
of this function ?
1. phptutor
2. phptutor/index.php
3. index.php
4. /index.php
Answer: 3
42. Below program will call the function display_result() ?
<?php
$x="display";
${$x.'_result'} ();
?>
1. False
2. True
3. Parser Error
4. None of the above
Answer: 2
43. What gets printed?
<?php
$str="3dollars";
$a=20;
$a+=$str;
print($a);
?>
1. 23dollars
2. 203dollars
3. 320dollars
4. 23
Answer: 4
44. What gets printed?
<?php
function zz(& $x)
{
$x=$x+5;
}
?>
$x=10;
10 | P a g e Pankaj Kumar Jha (www.globaljournals.org)
11. zz($x);
echo $x;
1. 5
2. 0
3. 15
4. 10
Answer: 3
45. What is the following output?
<?php
$x=dir(".");
while($y=$x->read())
{
echo $y."
"
}
$y->close();
?>
1. display all folder names
2. display a folder content
3. display content of the all drives
4. Parse error
Answer: 2
46. <?php
$test="3.5seconds";
settype($test,"double");
settype($test,"integer");
settype($test,"string");
print($test);
?>
What is the following output?
1. 3.5
2. 3.5seconds
3. 3
4. 3second
Answer: 3
47. PHP is
1. Partially cross-platform
11 | P a g e Pankaj Kumar Jha (www.globaljournals.org)
12. 2. Truly cross-platform
3. None of above
Answer: 2
48. PHP is a _____ . It means you do not have to tell PHP which data type the variable is.PHP
automatically converts the variable to the correct data type, depending on its value.
1. client side language
2. local language
3. global language
4. loosely typed language
Answer: 4
49. Which of the following function is used to change the root directory in PHP?
1. choot()
2. change_root()
3. cd_root()
4. cd_r()
Answer: 1
50. The PHP syntax is most similar to:
1. PERL and C
2. Java script
3. VB Script
4. Visual Basic
Answer: 1
51. What will be the output of below code ?
<?php
$arr = array(5 => 1, 12 => 2);
$arr[] = 56;
$arr["x"] = 42;
echo var_dump($arr);
?>
1. 42
2. array(3) { [12]=> int(2) [13]=> int(56) ["x"]=> int(42) }
3. array(4) { [5]=>int(1) [12]=> int(2) [13]=> int(56) ["x"]=> int(42) }
4. 1,2,56,42
Answer: 3
52. What is the output of the following PHP script?
12 | P a g e Pankaj Kumar Jha (www.globaljournals.org)
13. <?php
define('SOMEVAL', 0);
if (strlen(SOMEVAL) > 0) {
echo "Hello";
}
else {
echo "Goodbye";
}
?>
1. Goodbye
2. Hello
3. Syntax Error
Answer:
53. Consider the following PHP code:
<?php
$myArray = array(
10, 20, 30, 40
);
?>
What is the simplest way to return the values 20 and 30 in a new array without
modifying $myArray?
1. array_slice($myArray, 1, 2);
2. array_splice($myArray, 2, 1);
3. array_slice($myArray, 2, 1);
4. array_slice($myArray, 10, 20);
Answer:
54. What will this output
<?php
$a = false;
$b = true;
$c = false;
if ($a ? $b : $c) {
echo "false";
} else {
echo "true";
}
?>
13 | P a g e Pankaj Kumar Jha (www.globaljournals.org)
14. Answer: true
Explanation: If $a is true, then $b will be evaluated; otherwise (as is the case here) $c will be
evaluated. As $c is false, the conditional evaluates as false, and the script (confusingly) prints
true.
55: What can you use to replace like with hate in I like Regular Expressions?
Answer: preg_replace("/like/", "hate", "I like Regular Expressions")
Explanation: The search is a regular expression and it has slashes around it, the replace isn't,
so it doesn't have any slashes.
56. What library do you need in order to process images?
Answer. GD library
57. What function sends mail:
Answer: imap_mail, mail
58: What is the problem with <?=$expression ?> ?
Answer: It requires short tags and this is not compatible with XML
Explanation: If you have short_open_tag On then this XML <?xml version="1.0" encoding="utf-
8"?> (for example) will be parsed by the PHP engine, causing both a PHP and a XML parsing
error.
59: Put this line php display_errors=false in a .htaccess file when you deploy the application?
Answer: That won't hide any error 'coz it's not the correct code
Explanation: I would have said 'Good idea, increases security', but wait a minute... the correct
syntax is php_flag display_errors Off ...
60. Which of the following regular expressions will match the string go.go.go?
Answer: ........
Explanation: Any character (twice) followed by a period followed by any character (twice)
followed by ...
61: A constructor is a special kind of _______________
Answer: Method
Explanation: It is a function, but since it's in a class we call it a method.
14 | P a g e Pankaj Kumar Jha (www.globaljournals.org)
15. 62: What does break; do?
Answer: Ends execution of the current for, foreach, while, do-while or switch structure
Explanation: Yup. If you were tempted to say 'moves on to the next iteration', that's the continue
statement.
63: Can this PHP code be valid:
$4bears = $bears->getFirst4();
Answer: No
Explanation: A variable name can't start with a number. Don't ask me why not, I don't see any
reason why it shouldn't; it's probably some carry over from C.
64. What will this output:
<?php
$dog = "Dogzilla";
$dragon = &$dog;
$dragon = "Dragonzilla";
echo $dog." ";
echo $dragon;
?>
Answer: Dragonzilla Dragonzilla
Explanation: $dragon is really $dog, it just has a different name.
65: Assuming all the variables a, b, c have already been defined, could this be a variable name:
${$a}[$b][$c] ?
Answer: Yes
Explanation: Yup, it's a multidimensional array.
66: In MySQL, if you want to find out about the structure of a table tblQuiz, what will you use?
Answer: DESCRIBE tblQuiz
67: In which of the following scenarios might you use the function md5?
1. perform large number multiplication
2. perform authentication without unnecessarily exposing the access credentials
Answer: 2
15 | P a g e Pankaj Kumar Jha (www.globaljournals.org)
16. Explanation: md5 returns an unique hash string for the string you pass it; if you have only the
hash it's practically impossible to find the string that produces it.
68: What does this function do:
<?php
function my_func($variable)
{
return (is_numeric($variable) && $variable % 2 == 0);
}
?>
Answer: tests whether $variable is an even number
Explanation: It returns true if $variable is divisible by 2.
69: How do you find the square root of a number?
Answer: In both PHP and MySQL you have a function called sqrt
70: Assuming results of a bunch of quizzes are kept in the following table, how do you print all
the quizzes' names and their average score (quizName is 'Php Mysql', 'Css Html', 'Web Design'
and so on for other quizzes)?
+--------------+--------------+
| Field | Type |
+--------------+--------------+
| userName | varchar(20) |
| userScore | tinyint(3) |
| userComments | varchar(255) |
| quizName | varchar(20) |
+--------------+--------------+
Answer: select quizName, avg(userScore) from tblQuiz group by quizName;
71: Is this quiz table normalized and is that OK?
+--------------+--------------+
| Field | Type |
+--------------+--------------+
| userName | varchar(20) |
| userEmail | varchar(20) |
| userScore | tinyint(3) |
| userComments | varchar(255) |
| quizName | varchar(20) |
| quizType | varchar(20) |
| quizUrl | varchar(20) |
16 | P a g e Pankaj Kumar Jha (www.globaljournals.org)
17. +--------------+--------------+
Answer: it's not normalized, and that's NOT OK
Explanation: The quiz data (name, type, url) should be moved in a new table because it repeats
itself on many rows. The table that stores results should be linked to this new table by a foreign
key.
72: Which is the correct timeline (OO stands for object oriented)?
1. OO Programming, OO Analysis, OO Design
2. OO Analysis, OO Design, OO Programming
Answer: 2
Explanation: First Analysis, then Design, then Programming.
73: What does this output:
class T
{
public $m = "a";
function T()
{
$this->m = "b";
}
}
$t = new T();
$p = $t->m;
$p = "c";
echo $t->m;
Answer: b
Explanation: $p = "c"; does not modify the object member.
17 | P a g e Pankaj Kumar Jha (www.globaljournals.org)