PHP Interview Questions Answers| PHP Tutorials | Technical Questions

Recent Question and Answers

1)Time triggered caching (expiry timestamp). 2)Content change triggered caching (sensitive content has changed, so cache must be updated). 3)Manually triggered caching (manually inform the application that information is outdated, and force a new cache creation). ....! SELECT CURTIME(); SELECT CURDATE(); SELECT CURRENT_TIME(); SELECT CURRENT_DATE(); ....! SELECT COUNT(*) FROM tb_nme; ....!
$stringOfText = "<p>This is a test</p>"; $expression = "/<(.*?)>(.*?)<\/(.*?)>/"; echo preg_replace($expression, "\\2", $stringOfText); ....! DROP TABLE table_name Will DELETE the table and DATA TRUNCATE TABLE table_name Will DELETE the table DATA not the table definition ....! 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....!
Static Keyword Declaring class members or methods as static makes them accessible without needing an instantiation of the class. A member declared as static can not be accessed with an instantiated class object (though a static method can). The static declaration must be after the visibility declaration. For compatibility with PHP 4, if no visibility declaration is used, then the member or method will be treated as if it was declared as public. Because static methods are callable without an instance of the object created, the p....! * Anything from a form* Anything from $_GET, $_POST, $_REQUEST* Cookies ($_COOKIES)* Web services data* Files* Some server variables (e.g. $_SERVER['SERVER_NAME'])* Environment variables* Database query results Filter supports get, post, cookies, server and environment variables as well as defined variables (server support may not work in all sapi, for filter 0.11.0 or php 5.2.0). ....! ***************************** ASP Arrays to PHP ***************************** WDDX also allows more-complicated data structures to be passed between applications. Here we will pass an array from an ASP WDDX script to a PHP script. An ASP Script to Serialize an Array into a WDDX Packet <% 'define data as ASP array dim names names = Array("Andrew", "Emma", "Terry", "Mary", "Thomas") set wddxob = Server.....! string urlencode(str) where str contains a string like this “hello world” and the return value will be URL encoded and can be use to append with URLs, normaly used to appned data for GET like someurl.com?var=hello%world string urldocode(str) this will simple decode the GET variable’s valueLike it echo (urldecode($_GET_VARS[var])) will output “Hello world” ....! <?php$a = 1;$a = $a— + 1;echo $a;?> A. 2B. 1C. 3D. 0E. Null Answer B is correct. ....! You can download apache2triad from http://sourceforge.net/projects/apache2triad/ Its a single setup file for --------------------------- Apache2 , MySQL , PostgreSQL , OpenSSL , Xmail , SlimFTPd Software developing triad of : PHP , Perl and Python + Apache2TriadCP , PHPmyadmin , PHPPgAdmin , AWStats , UebiMiau , PHPXMail , PHPSFTPd. All latest stables , all manuals Use t....! www.w3answers.com when we do the select queries that retrieve large data sets from MySQL, mysql_unbuffered_query in PHP is likely to give better performance than mysql_query. PHP manual says, it “sends a SQL query query to MySQL, without fetching and buffering the result rows automatically”. a) sizeof($urarray) This function is an alias of count()b) count($urarray) ....! you can achieve this using curl in php see the example below. function curl_get_con_url($url, $user_agent = '', $referer = '') { // create a new CURL resource $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); /* This lines will make sure that you can save the web page into a variable */ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CUR....!

you can achieve this using curl in php

see the example below.

function curl_get_con_url($url, $user_agent = '', $referer = '') {
// create a new CURL resource
$ch = curl_init();

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);

/* This lines will make sure that you can save the web page into a variable */
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CUR....!