Basic PHP Programming Interview Questions and Answers

PHP Questions and Answers:

1 :: How To Read the Entire File into a Single String?

If you have a file, and you want to read the entire file into a single string, you can use the file_get_contents() function. It opens the specified file, reads all characters in the file, and returns them in a single string. Here is a PHP script example on how to file_get_contents():

<?php
$file = file_get_contents("/windows/system32/drivers/etc/services");
print("Size of the file: ".strlen($file)."n");
?>

This script will print:

Size of the file: 7116
5/5 Rating (1 vote)
Is This Answer Correct?    3 Yes 2 No
Place Your Answer

2 :: How many ways can we get the value of current session id?

session_id() returns the session id for the current session.
3/5 Rating (1 vote)
Is This Answer Correct?    6 Yes 1 No
Place Your Answer

3 :: What is the difference between include and require?

It’s how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.
4/5 Rating (1 vote)
Is This Answer Correct?    7 Yes 0 No
Place Your Answer

4 :: Explain the ternary conditional operator in PHP?

Expression preceding the ? is evaluated, if it’s true, then the expression preceding the : is executed, otherwise, the expression following : is executed.
4/5 Rating (1 vote)
Is This Answer Correct?    7 Yes 0 No
Place Your Answer

5 :: How To Turn On the Session Support in PHP?

The session support can be turned on automatically at the site level, or manually in each PHP page script:

* Turning on session support automatically at the site level: Set session.auto_start = 1 in php.ini.
* Turning on session support manually in each page script: Call session_start() funtion.
5/5 Rating (1 vote)
Is This Answer Correct?    6 Yes 0 No
Place Your Answer

Rate This Category:
4/5 Rating (1 vote)
Place Your Question



Top: Basic PHP Programming Interview Questions and Answers
Basic PHP Programming Interview Questions and Answers

Top Frequently Asked PHP Question
Frequently Asked PHP Job Interview Question


Top Frequently opened Computer Programming Job Interview categories
Most popular Computer Programming Job Interview categories

Comments About Basic PHP Programming Interview Questions and Answers

Share your valuable opinions, ideas and suggestions about Basic PHP Programming Interview Questions and Answers
While placing your comment your email address is required but won't be published any where else; Personal information will be kept confidential; we do not sell or release our respective visitors private information.
  1. Webmaster 20th of May 2012

    Webmaster Said

    Tell us what you feel about Basic PHP Programming Interview Questions and Answers
    All comments will be published after review. No login or registration is required to post a comment on Basic PHP Programming Interview Questions and Answers We offer and invite you to submit your valuable comment now; Please be respectful of others when commenting. Insulting others, self-promotional comments, website promotional comments, marketing stuff, SEO Techniques, SMS-style content and off-topic comments will not be approved at this information portal.
    So start sharing your thoughts regarding Basic PHP Programming Interview Questions and Answers
    Thank you.

Leave a Comment

Leave a Comment
  1.  Enter This Verification Code  Regenerate Verification Code  



Your reply will be added to the comment above (Below any other replies to this comment) -

Top Comments About: Basic PHP Programming Interview Questions and Answers
Comments on Basic PHP Programming Interview Questions and Answers

 
Top of Link batk to Basic PHP Programming Interview Questions and Answers
Link batk to Basic PHP Programming Interview Questions and Answers