PHP Interview Questions Answers| PHP Tutorials | Technical Questions

Recent Question and Answers

AJAX requests should use an HTTP GET request when retrieving data where the data will not change for a given request URL. An HTTP POST should be used when state is updated on the server. This is in line with HTTP idem potency recommendations and is highly recommended for a consistent web application architecture. ....! Model-view-controller (MVC) is a design pattern used in software engineering. In complex computer applications that present lots of data to the user, one often wishes to separate data (model) and user interface (view) concerns, so that changes to the user interface do not impact the data handling, and that the data can be reorganized without changing the user interface. The model-view-controller design pattern solves this problem by decoupling data access and business logic from data presentation and user interaction, by introducing an intermediate....! # Use ip2long() and long2ip() to store the IP adresses as Integers instead of storing them as strings, which will reduce the space from 15 bytes to 4 bytes. This will also increase search speed and make it easy to see if a ip falls within a specified range. # Use gzcompress() and gzuncompress() to reduce the strings before you store them in a database. The gzcompress can compress plain-text up to 90%. The only reason why you shouldn’t use it is when you need full-text indexing capabilities.
Anything. PHP is mainly focused on server-side scripting, so you can do anything any other CGI program can do, such as collect form data, generate dynamic page content, or send and receive cookies. But PHP can do much more. There are three main areas where PHP scripts are used. Server-side scripting. This is the most traditional and main target field for PHP. You need three things to make this work. The PHP parser (CGI or server module), a webserver and a web browser. You need to run the webserver, with a conn....! function isbn10_to_13($isbnold){ if (strlen($isbnold) != 10){ // Make sure we have a 10 digit string to startreturn 'Invalid ISBN-10, must be 10 digits';} // prefix with 978 and drop old checksum (last digit)$isbn = '978'.substr($isbnold,0,9); for ($i = 0; $i <= 12; $i++){ // For each digit if new isbn$weight = ($i%2 == 0)? 1 : 3; // Alternate between 1's and 3's$check_sum_total = $check_sum_total + ($isbn{$i} * $weight); // multiply each digit by 1 or 3 and add to $checksumtotal} $....! <?php $here = "/home/httpd/html/test "; list ($j1,$j2,$j3,$j4) = split('/',$here); print "$j3"; ?> a. home b. Array c. test d. httpd ANS: httpd www.w3answers.com   ....!
PHP has a few other functions that can be useful when you're working with WDDX: <?php $names = array("Andrew", "Emma"); $name2 = "Terry"; $name3 = "Mary"; $name4 = "Thomas"; $wddxpack = wddx_packet_start("PHP-WDDX"); wddx_add_vars($wddxpack, "names"); wddx_add_vars($wddxpack, "name2"); wddx_add_vars($wddxpack, "name3"); wddx_add_vars($wdd....! PHP strings can be changed, but the most common practice seems to be to treat strings as immutable.Strings can be changed by treating them as character arrays and assigning directly into them, like this: <?php $my_string = “abcdefg”; $my_string[5] = “X”; print($my_string . “<BR>”); which will give the browser output: abcdeXg ?>   "AJAX is an acronym for Asynchronous JavaScript and XML. If you think it doesn't say much, we agree. Simply put, AJAX can be read "empowered JavaScript", because it essentially offers a technique for client-side JavaScript to make background server calls(such as from PHP,ASP.NET,JSP,RUby etc) and retrieve additional data as needed, updating certain portions of the page without causing full page reloads". The XMLHttpRequest object enables JavaScript to access the server asynchronously, so that the u....! Ans: MySQL SET function can take zero or more values, but at the maximum it can take 64 values. ....! In computing, phishing is a form of criminal activity using social engineering techniques. It is characterized by attempts to fraudulently acquire sensitive information, such as passwords and credit card details, by masquerading as a trustworthy person or business in an apparently official electronic communication. Phishing is typically carried out using email or an instant message. The term phishing derives from password harvesting and the use of increasingly sophisticated lures to "fish" for users' financial information and passwords. <?php$x = 3 - 5 % 3;echo $x;?>A. 2B. 1C. NullD. TrueE. 3 Answer A is correct. Because of operator precedence, the modulus operation isperformed first, yielding a result of 2 (the remainder of the division of 5 by 2).Then, the result of this operation is subtracted from the integer 3. ....! <? $text = 'php m programmer'; echo strpbrk($text, 'm'); ?> a) mmer b) mer c) all of the above d) none of the above ANS: none of the above NOTE: if we execute the above code we get the output as 'm programmer' ....! It Makes the MySQL engine refuse UPDATE and DELETE commands where the WHERE clause is not present. ....! MySQL (pronounced "my ess cue el") is an open source relational database management system (RDBMS) that uses Structured Query Language (SQL), the most popular language for adding, accessing, and processing data in a database. Because it is open source, anyone can download MySQL and tailor it to their needs in accordance with the general public license. MySQL is noted mainly for its speed, reliability, and flexibility

MySQL (pronounced "my ess cue el") is an open source relational database management system (RDBMS) that uses Structured Query Language (SQL), the most popular language for adding, accessing, and processing data in a database. Because it is open source, anyone can download MySQL and tailor it to their needs in accordance with the general public license. MySQL is noted mainly for its speed, reliability, and flexibility