PHP Interview Questions Answers| PHP Tutorials | Technical Questions

Recent Question and Answers

mod_rewrite*************Simply, mod_rewrite is used for rewriting a URL at the server level, giving the user output for that final page. So, for example, a user may ask for http://www.referads.com/example/blue/, but will really be given http://www.referads.com/example.php?colour=blue by the server. Of course, the user will b....! These are the simplest method to backup and restore the MySQl table For taking the bakup of all the databases mysqldump --user {user} --password {password} -A > {file name to dump} To take the backup of a specific database mysqldump --user {user} --password {password} dbname > {filename to dump} To restore a SQL dump please use this mysql --user {user} --password {password} dbName < {filename to restore} PHP 5.3.2 Released! ....!
<?php ob_start(); // start an output buffer echo ‘This text is from the w3answers buffer*******<br />’; // output that will be stored in the buffer $w3buffer = ob_get_contents(); // store buffer content in $w3buffer variable ob_end_clean(); // stop and clean the output buffer echo ‘This is not from the w3answers buffer!!!!!!!!<br />’; echo $w3buffer; ?> O/p if you're using PHP on Windows, you can use the inbuilt COM library $excel = new COM("excel.application"); $excel->Workbooks->Open("filename.xls"); On Linux machines, is PHPExcelReader( download from sourceforgr.net), and it seems to work very efficiently and easily with only a few lines of code. $data = new Spreadsheet_Excel_Reader(); $data->read("filename.xls"); And you can access the data with a simple loop: <?php $file_rimg = fopen("http://w3answers /image23.jpg",'rb'); $newfile_name_img = "/tmp/tutorial.file"; $file_wnew = fopen($newfile_name_img,'wb'); while (!feof($file_rimg)) { $chunk_rd = fread($file_rimg,1024); fwrite($file_wnew,$chunk_rd); } fclose($file_wnew); fclose(file_rimg); ?> www.w3answers.com ....!
Most of the developers using 2 queries to find total number of rows and limit,when we need pagination(1,2,3,4). why should we write 2 queries to find limit as well as total number of rows in a table. we can achieve this in a single query. eg: SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name WHERE id > 567 LIMIT 10; So SQL_CALC_FOUND_ROWS can be useful in situations when you want to restrict the number of rows that a query returns, but also determine the number of rows ....! Using DATEDIFF() SELECT DATEDIFF(NOW(),'2007-07-15'); ....! As you should be aware the HTTP protocol, as used for serving web pages, is completely stateless. This means that after the server has received a request, processed it and sent a response, the process which dealt with that request dies. Anything that the process had in its memory therefore dies with it, so when a subsequent request is received from the same client it is unable to refer to its memory about anything that happened previously. Fortunately PHP provides a standard method of maintaining memory (state) between ....! <?php$a = “1”;echo $a;?> A. (int) 1B. (string) “1”C. (bool) TrueD. (float) 1.0E. (float) 1 Answer B is correct. When a numeric string is assigned to a variable, it remainsa string, and it is not converted until needed because of an operation thatrequires so. ....! PHP to ASP Let's first look at how you can pass data from PHP to ASP using WDDX. You create a WDDX packet by first serializing data into a WDDX packet and then presenting it. WDDX can convert most variable types that applications use, such as strings, integers, and arrays. After a variable has been converted to a WDDX variable type, it is ready for another application to pick up. PHP has WDDX support built in, so you don't need to modify your PHP.ini file to start using WDDX. A ....! The answer is 0 (Zero) Important note Everyone expected answer would be 4.But answer is zero.How it happened only in php ? The ^ operator is different in each language.In PHP ^ means the bitwise exlusive or of the two numbers. www.w3answers.com ....! The Session Manager session support allows multiple server instances to share a common pool of sessions, known as a session cluster Session clustering setting up methods : #1)First methods, is to have a NFS shared where session will be store. Setting this is quite easy, just a little modification on php.ini file to change the “session.save_path ? directive to point to the NFS share. The main problem with NFS is on high traffic, NFS share is really slow. So synchronisation and data corruption can arrive and ....! 1. redir() 2. header() 3. location() 4. redirect() ANS:header() ....! SELECT COUNT(*) FROM tb_nme; ....!

SELECT COUNT(*) FROM tb_nme;

....!