PHP Test 8 Which of the following will not combine strings $s1 and $s2 into a single string? $s1 + $s2 "{$s1}{$s2}" $s1.$s2 implode(' ', array($s1,$s2)) Given a variable $email containing the string [email protected], which of the following statements would extract the string example.com? substr($email, strpos($email, "@")+1); strchr($email, "@"); strstr($email, "@"); substr($email, strpos($email, "@")); Given a comma-separated list of values in a string, which function from the given list can create an array of each individual value with a single call? extract() explode() strtok() strstr() What is the best all-purpose way of comparing two strings? Using strcmp() Using strcasecmp() Using the == operator Using the strpos function Which of the following PCRE regular expressions best matches the string php|architect? .* [az]{3}\|[az]{9} [a-z][a-z][a-z]\|\w{9} \d{3}\|\d{8} Which of the following functions can be used to determine the integrity of a string? sha1() md5() crc32() all of the above What happens if you add a string to an integer using the + operator? The integer and string are concatenated together in a new string The string is discarded and the integer is preserved The string is converted to a number and added to the integer The interpreter outputs a type mismatch error The ___________ function can be used to compare two strings using a case-insensitive binary algorithm? stristr() strcasecmp() stricmp() strcmp() Which of the following functions can be used to convert the binary data stored in a string into its hexadecimal representation? encode_hex() pack() hex2bin() bin2hex() ^[A-Za-z].* matches (a) play it again (b) i (c) 123 (d) both (A) and (B) ^[0-9]{5}(\-[0-9]{4})?$ matches 90001 and 90002-4323 9001 and 12-4321\ How do you get information from a form that is submitted using the "get" method? .$_POST[]; Request.Query String; Request.Form; $_GET[]; What's the best way to copy a file from within a piece of PHP? Use "exec" to run an operating system command such as cp (Unix, Linux) or copy (Windows) Use the built in copy() function Open the input and output files, and use read() and write() to copy the data block by block until read() returns a zero out a message asking your user to "telnet" in to the server and copy the file for you PHP code is embedded directly into XHTML document? True False Is it possible to submit a form with out a submit button? No Yes What is the out put? $x=array("aaa","ttt","www","ttt","yyy","tttt"); $y=array_count_values($x); echo $y[ttt]; 1 2 3 4 In php Which method is used to getting browser properties? $_SERVER['SERVER_NAME'] $_SERVER['HTTP_USER_AGENT']; $_SERVER['HTTP_VARIENT'] $_SERVER['PHP_SELF'] What is the expansion of LAMP? Linux Apache Mysql Php Linux And Mysql Php What is the output? $x=array(1,3,2,3,7,8,9,7,3); $y=array_count_values($x); echo $y[8]; 1 8 6 43 Which of the following function is used to pick one or more random values from PHP Array? Random_array() array_rand() Rand_array() array_random() Schreibe einen Kommentar Antworten abbrechenDu musst angemeldet sein, um einen Kommentar abzugeben.