\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Lilava} \pdfinfo{ /Title (functions.pdf) /Creator (Cheatography) /Author (Lilava) /Subject (functions Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A33CA3} \definecolor{LightBackground}{HTML}{F9F2F9} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{functions Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Lilava} via \textcolor{DarkBackground}{\uline{cheatography.com/64138/cs/16302/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Lilava \\ \uline{cheatography.com/lilava} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 11th July, 2018.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions construct}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{The constructs for(), foreach(), and each() can all be used to iterate an object if the object... \newline % Row Count 2 (+ 2) A. implements ArrayAccess \newline % Row Count 3 (+ 1) B. implements Iterator \newline % Row Count 4 (+ 1) C. implements Iterator and ArrayAccess \newline % Row Count 5 (+ 1) D. None of the above% Row Count 6 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer : C} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Which PHP function is used to validate whether the contents of \newline % Row Count 2 (+ 2) \$\_FILES{[}'name'{]}{[}'tmp\_name'{]} have really been uploaded via HTTP, and also save the contents into another folder?% Row Count 5 (+ 3) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer : move\_uploaded\_file(), move\_uploaded\_file} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Which PHP function sets a cookie and URL encodes its value when sending it to the \newline % Row Count 2 (+ 2) browser?% Row Count 3 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer: setcookie, setcookie()} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Which PHP function sets a cookie whose value does not get URL encoded when sending it to the browser?% Row Count 3 (+ 3) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{setrawcookie, setrawcookie()} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{What function can reverse the order of values in an array so that keys are preserved? \newline % Row Count 2 (+ 2) A. array\_flip() \newline % Row Count 3 (+ 1) B. array\_reverse() \newline % Row Count 4 (+ 1) C. rsort() \newline % Row Count 5 (+ 1) D. krsort() \newline % Row Count 6 (+ 1) E. array\_multisort()% Row Count 7 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer: B} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{PHP's array functions such as array\_values() can be used on an object if the object... \newline % Row Count 2 (+ 2) A. implements Traversable \newline % Row Count 3 (+ 1) B. is an instance of ArrayObject \newline % Row Count 4 (+ 1) C. implements ArrayAccess \newline % Row Count 5 (+ 1) D. None of the above% Row Count 6 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer: D} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{You need to escape special characters to use user input inside a regular expression. \newline % Row Count 2 (+ 2) Which functions would you use? (Choose 2) \newline % Row Count 3 (+ 1) A. addslashes() \newline % Row Count 4 (+ 1) B. htmlentities() \newline % Row Count 5 (+ 1) C. preg\_quote() \newline % Row Count 6 (+ 1) D. regex\_quote() \newline % Row Count 7 (+ 1) E. quote\_meta()% Row Count 8 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer: C, E} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Which function can NOT help prevent cross-site scripting? (Choose 2) \newline % Row Count 2 (+ 2) A. addslashes() \newline % Row Count 3 (+ 1) B. htmlentities() \newline % Row Count 4 (+ 1) C. htmlspecialchars() \newline % Row Count 5 (+ 1) D. strip\_tags() \newline % Row Count 6 (+ 1) E. quotemeta()% Row Count 7 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer: A, E} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Which of these error types may be handled by user defined error handler function? \newline % Row Count 2 (+ 2) A. E\_ERROR \newline % Row Count 3 (+ 1) B. E\_NOTICE \newline % Row Count 4 (+ 1) C. E\_PARSE \newline % Row Count 5 (+ 1) D. E\_WARNING% Row Count 6 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer: A, C} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{You want to allow your users to submit HTML code in a form, which will then be displayed \newline % Row Count 2 (+ 2) as real code and not affect your page layout. Which function do you apply to the text, when \newline % Row Count 4 (+ 2) displaying it? (Choose 2) \newline % Row Count 5 (+ 1) A. strip\_tags() \newline % Row Count 6 (+ 1) B. htmlentities() \newline % Row Count 7 (+ 1) C. htmltidy() \newline % Row Count 8 (+ 1) D. htmlspecialchars() \newline % Row Count 9 (+ 1) E. showhtml()% Row Count 10 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer: B, D} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{You want to parse a URL into its single parts. Which function do you choose? \newline % Row Count 2 (+ 2) A. parse\_url() \newline % Row Count 3 (+ 1) B. url\_parse() \newline % Row Count 4 (+ 1) C. get\_url\_parts() \newline % Row Count 5 (+ 1) D. geturlparts()% Row Count 6 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer: A} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Which of the following functions are used to escape data within the context of HTML? \newline % Row Count 2 (+ 2) (Choose 2) \newline % Row Count 3 (+ 1) A. htmlentities() \newline % Row Count 4 (+ 1) B. addslashes() \newline % Row Count 5 (+ 1) C. stripslashes() \newline % Row Count 6 (+ 1) D. strip\_tags() \newline % Row Count 7 (+ 1) E. htmlspecialchars()% Row Count 8 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer : A,E} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{What will the following function call print? \newline % Row Count 1 (+ 1) printf('\%010.6f', 22); \newline % Row Count 2 (+ 1) A. 22 \newline % Row Count 3 (+ 1) B. 22.00 \newline % Row Count 4 (+ 1) C. 022.000000 \newline % Row Count 5 (+ 1) D. 22.000000% Row Count 6 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer : C} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Which elements does the array returned by the function pathinfo() contain? \newline % Row Count 2 (+ 2) A. root, dir, file \newline % Row Count 3 (+ 1) B. dirname, filename, fileextension \newline % Row Count 4 (+ 1) C. dirname, basename, extension \newline % Row Count 5 (+ 1) D. path, file% Row Count 6 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer: C} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Comparison func and operator}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{What is the difference between the spaceship operator (\textless{}=\textgreater{}) and the strcmp() function? \newline % Row Count 2 (+ 2) A. There is no difference in functionality \newline % Row Count 3 (+ 1) B. strcmp() returns a Boolean value, the spaceship operator a number \newline % Row Count 5 (+ 2) C. strcmp() does a case-intensive comparison, the spaceship operator does not \newline % Row Count 7 (+ 2) D. The spaceship operator returns -1, 0 or 1; strcmp() may return any integer% Row Count 9 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer : D} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Anonimous Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Which of the following statements about anonymous functions in PHP are NOT true? (Choose 2) \newline % Row Count 2 (+ 2) A. Anonymous functions can be bound to objects \newline % Row Count 3 (+ 1) B. Anonymous functions created within object context are always bound to that object \newline % Row Count 5 (+ 2) C. Assigning closure to a property of an object binds it to that object \newline % Row Count 7 (+ 2) D. Methods bind() and bindTo() of the Closure object provide means to create closures with different binding and scope \newline % Row Count 10 (+ 3) E. The binding defines the value of \$this and the scope for a closure% Row Count 12 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer: B,C} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{What function allows resizing of PHP's file write buffer? \newline % Row Count 2 (+ 2) A. ob\_start() \newline % Row Count 3 (+ 1) B. set\_write\_buffer() \newline % Row Count 4 (+ 1) C. \seqsplit{stream\_set\_write\_buffer()} \newline % Row Count 5 (+ 1) D. Change the output\_buffering INI setting via ini\_set() function% Row Count 7 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer: C} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Which constant must be passed as the second argument to htmlentities() to convert single \newline % Row Count 2 (+ 2) quotes (') to HTML entities? \newline % Row Count 3 (+ 1) A. TRUE \newline % Row Count 4 (+ 1) B. FALSE \newline % Row Count 5 (+ 1) C. ENT\_QUOTES \newline % Row Count 6 (+ 1) D. ENT\_NOQUOTES \newline % Row Count 7 (+ 1) E. ENT\_COMPAT% Row Count 8 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer: C} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{What is the name of the PHP function used to automatically load non-yet defined classes? \newline % Row Count 2 (+ 2) A. autoload() \newline % Row Count 3 (+ 1) B. \_ \_autoload() \newline % Row Count 4 (+ 1) C. \_ \_catch() \newline % Row Count 5 (+ 1) D. load() \newline % Row Count 6 (+ 1) E. loadClass()% Row Count 7 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer: B} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Which PHP function retrieves a list of HTTP headers that have been sent as part of the \newline % Row Count 2 (+ 2) HTTP response or are ready to be sent? \newline % Row Count 3 (+ 1) A. header() \newline % Row Count 4 (+ 1) B. headers() \newline % Row Count 5 (+ 1) C. headers\_list() \newline % Row Count 6 (+ 1) D. headers\_sent() \newline % Row Count 7 (+ 1) E. getresponseheaders()% Row Count 8 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer: C} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{What is the name of the function that allows you register a set of functions that implement \newline % Row Count 2 (+ 2) user-defined session handling? \newline % Row Count 3 (+ 1) A. session\_set\_handler() \newline % Row Count 4 (+ 1) B. \seqsplit{session\_set\_storage\_handler()} \newline % Row Count 5 (+ 1) C. \seqsplit{session\_register\_handler()} \newline % Row Count 6 (+ 1) D. \seqsplit{session\_set\_save\_handler()}% Row Count 7 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer: D} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{What function is best suited for extracting data from a formatted string into an array? \newline % Row Count 2 (+ 2) A. fgetcsv \newline % Row Count 3 (+ 1) B. sscanf \newline % Row Count 4 (+ 1) C. sprintf \newline % Row Count 5 (+ 1) D. strtok% Row Count 6 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer : C} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{What function can be used to retrieve an array of current options for a stream context? \newline % Row Count 2 (+ 2) A. \seqsplit{stream\_context\_get\_params} \newline % Row Count 3 (+ 1) B. \seqsplit{stream\_context\_get\_default} \newline % Row Count 4 (+ 1) C. \seqsplit{stream\_context\_get\_options} \newline % Row Count 5 (+ 1) D. The 'options' element of the stream\_get\_meta\_data return value% Row Count 7 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer : C} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Which of the following is NOT a valid function declaration? \newline % Row Count 2 (+ 2) A. function x (\$x1= array()) \newline % Row Count 3 (+ 1) B. function x (A \$x1) \newline % Row Count 4 (+ 1) C. function x (A \$x1 = null) \newline % Row Count 5 (+ 1) D. function x (\$x1 = \$x2)% Row Count 6 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer : D} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Which of the following PHP functions can be used to set the HTTP response code? (chosee 2) \newline % Row Count 2 (+ 2) A. header\_add() \newline % Row Count 3 (+ 1) B. header() \newline % Row Count 4 (+ 1) C. http\_set\_status() \newline % Row Count 5 (+ 1) D. http\_response\_code() \newline % Row Count 6 (+ 1) E.http\_header\_set()% Row Count 7 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer: B, D} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Which PHP function is uses to validate wheather the contents of \$\_FILES{[}'name'{]}{[}'tmp\_name'{]} have relly been uploaded via HTTP?% Row Count 3 (+ 3) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer : is\_uploaded\_file(), is\_uploaded\_file} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{How do you allow the caller to submit a variable number of arguments to a function? \newline % Row Count 2 (+ 2) A. Using a prototype like function test(... \$parameters). \newline % Row Count 4 (+ 2) B. Using a prototype like function test() and the function func\_get\_args() inside the function body. \newline % Row Count 7 (+ 3) C. Using a prototype like function test(\$parameters{[}{]}). \newline % Row Count 9 (+ 2) D. Using a prototype like function test() and the function get\_variable\_args() inside the function body. \newline % Row Count 12 (+ 3) E. This is not possible in PHP.% Row Count 13 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer : B} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Comparison func and operator}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{What is the difference between the spaceship operator (\textless{}=\textgreater{}) and the strcmp() function? \newline % Row Count 2 (+ 2) A. There is no difference in functionality \newline % Row Count 3 (+ 1) B. strcmp() returns a Boolean value, the spaceship operator a number \newline % Row Count 5 (+ 2) C. strcmp() does a case-intensive comparison, the spaceship operator does not \newline % Row Count 7 (+ 2) D. The spaceship operator returns -1, 0 or 1; strcmp() may return any integer% Row Count 9 (+ 2) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer : D} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{Functions}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{Which of the following functions will allow identifying unique values inside an array? \newline % Row Count 2 (+ 2) A. array\_unique\_values \newline % Row Count 3 (+ 1) B. array\_distinct \newline % Row Count 4 (+ 1) C. array\_count\_values \newline % Row Count 5 (+ 1) D. array\_intersect \newline % Row Count 6 (+ 1) E. array\_values% Row Count 7 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{8.4cm}}{Answer : C} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}