SlideShare ist ein Scribd-Unternehmen logo
1 von 6
1. Who is the father of PHP ?
Rasmus Lerdorf is known as the father of PHP.
2. What is the difference between $name and $$name?
$name is variable where as $$name is reference variable like
$name=sonia and $$name=singh so $sonia value is singh.
3. What are the method available in form submitting?
GET and POST
4.How can we get the browser properties using PHP?
<?php
echo $_SERVER[‘HTTP_USER_AGENT’].”nn”;
$browser=get_browser(null,true);
print_r($browser);
?>
5. What Is a Session?
A session is a logical object created by the PHP engine to allow you to
preserve data across subsequent HTTP requests. Sessions are commonly
used to store temporary data to allow multiple PHP pages to offer a
complete functional transaction for the same visitor.
6. How can we register the variables into a session?
<?php
session_register($ur_session_var);
?>
7. How many ways we can pass the variable through the navigation
between the pages?
Register the variable into the session
Pass the variable as a cookie
Pass the variable as part of the URL
8. How can we know the total number of elements of Array?
sizeof($array_var)
count($array_var)
9. How can we create a database using php?
mysql_create_db();
10. What is the functionality of the function strstr and stristr?
strstr() returns part of a given string from the first occurrence of a given
substring to the end of the string.
For example:strstr("user@example.com","@") will return
"@example.com".
stristr() is idential to strstr() except that it is case insensitive.
11. What are encryption functions in PHP?
CRYPT(), MD5()
12. How to store the uploaded file to the final location?
move_uploaded_file( string filename, string destination)
13. Explain mysql_error().
The mysql_error() message will tell us what was wrong with our query,
similar to the message we would receive at the MySQL console.
14. What is Constructors and Destructors?
CONSTRUCTOR : PHP allows developers to declare constructor
methods for classes. Classes which have a constructor method call this
method on each newly-created object, so it is suitable for any
initialization that the object may need before it is used.
DESTRUCTORS : PHP 5 introduces a destructor concept similar to that
of other object-oriented languages, such as C++. The destructor method
will be called as soon as all references to a particular object are removed
or when the object is explicitly destroyed or in any order in shutdown
sequence.
15. Explain the visibility of the property or method.
The visibility of a property or method must be defined by prefixing the
declaration with the keywords public, protected or private.
Class members declared public can be accessed everywhere.
Members declared protected can be accessed only within the class itself
and by inherited and parent classes.
Members declared as private may only be accessed by the class that
defines the member.
16. What are the differences between Get and post methods.
There are some defference between GET and POST method
1. GET Method have some limit like only 2Kb data able to send for
request
But in POST method unlimited data can we send
2. when we use GET method requested data show in url but
Not in POST method so POST method is good for send sensetive request
17. What are the differences between require and include?
Both include and require used to include a file but when included file not
found
Include send Warning where as Require send Fatal Error
18. What is use of header() function in php ?
The header() function sends a raw HTTP header to a client.We can use
herder()
function for redirection of pages. It is important to notice that header()
must
be called before any actual output is seen.
19. List out the predefined classes in PHP?
Directory
stdClass
__PHP_Incomplete_Class
exception
php_user_filter
20. What type of inheritance that PHP supports?
In PHP an extended class is always dependent on a single base class,that
is, multiple inheritance is not supported. Classes are extended using the
keyword 'extends'.
21. How can we encrypt the username and password using php?
You can encrypt a password with the following Mysql>SET
PASSWORD=PASSWORD("Password");
We can encode data using base64_encode($string) and can decode using
base64_decode($string);
22. What is the difference between explode and split?
Split function splits string into array by regular expression. Explode
splits a string into array by string.
For Example:explode(" and", "India and Pakistan and Srilanka");
split(" :", "India : Pakistan : Srilanka");
Both of these functions will return an array that contains India, Pakistan,
and Srilanka.
23. How do you define a constant?
Constants in PHP are defined using define() directive, like
define("MYCONSTANT", 100);
24. How do you pass a variable by value in PHP?
Just like in C++, put an ampersand in front of it, like $a = &$b;
25. What does a special set of tags <?= and ?> do in PHP?
The output is displayed directly to the browser.
26. How do you call a constructor for a parent class?
parent::constructor($value)
27. What’s the special meaning of __sleep and __wakeup?
__sleep returns the array of all the variables than need to be saved, while
__wakeup retrieves them.
28. What is the difference between PHP and JavaScript?
javascript is a client side scripting language, so javascript can make
popups and other things happens on someone’s PC. While PHP is server
side scripting language so it does every stuff with the server.
29. What is the difference between the functions unlink and unset?
unlink() deletes the given file from the file system.
unset() makes a variable undefined.
30. How many ways can we get the value of current session id?
session_id() returns the session id for the current session.
31. What are default session time and path?
default session time in PHP is 1440 seconds or 24 minutes
Default session save path id temporary folder /tmp
32. for image work which library?
we will need to compile PHP with the GD library of image functions for
this to work. GD and PHP may also require other libraries, depending on
which image formats you want to work with.
33. How can we get second of the current time using date function?
<?php
$second = date(“s”);
?>
34. What are the Formatting and Printing Strings available in PHP?
printf()- Displays a formatted string
sprintf()-Saves a formatted string in a variable
fprintf() -Prints a formatted string to a file
number_format()-Formats numbers as strings
35. How can we find the number of rows in a result set using PHP?
$result = mysql_query($sql, $db_link);
$num_rows = mysql_num_rows($result);
echo "$num_rows rows found";

Weitere ähnliche Inhalte

Was ist angesagt?

Nette framework (WebElement #28)
Nette framework (WebElement #28)Nette framework (WebElement #28)
Nette framework (WebElement #28)
Adam Štipák
 
Introduction to Thrift
Introduction to ThriftIntroduction to Thrift
Introduction to Thrift
Dvir Volk
 
The state of DI in PHP - phpbnl12
The state of DI in PHP - phpbnl12The state of DI in PHP - phpbnl12
The state of DI in PHP - phpbnl12
Stephan Hochdörfer
 
Understanding PHP objects
Understanding PHP objectsUnderstanding PHP objects
Understanding PHP objects
julien pauli
 

Was ist angesagt? (20)

Apache Thrift
Apache ThriftApache Thrift
Apache Thrift
 
PHP Interview Questions-ppt
PHP Interview Questions-pptPHP Interview Questions-ppt
PHP Interview Questions-ppt
 
The state of DI - DPC12
The state of DI - DPC12The state of DI - DPC12
The state of DI - DPC12
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
Nette framework (WebElement #28)
Nette framework (WebElement #28)Nette framework (WebElement #28)
Nette framework (WebElement #28)
 
Introduction to Thrift
Introduction to ThriftIntroduction to Thrift
Introduction to Thrift
 
Php presentation
Php presentationPhp presentation
Php presentation
 
tutorial54
tutorial54tutorial54
tutorial54
 
Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao)
Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao)Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao)
Sphinx autodoc - automated API documentation (EuroPython 2015 in Bilbao)
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
[4developers2016] PHP 7 (Michał Pipa)
[4developers2016] PHP 7 (Michał Pipa)[4developers2016] PHP 7 (Michał Pipa)
[4developers2016] PHP 7 (Michał Pipa)
 
Php
PhpPhp
Php
 
The state of DI in PHP - phpbnl12
The state of DI in PHP - phpbnl12The state of DI in PHP - phpbnl12
The state of DI in PHP - phpbnl12
 
Php
PhpPhp
Php
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
Understanding PHP objects
Understanding PHP objectsUnderstanding PHP objects
Understanding PHP objects
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Create your own PHP extension, step by step - phpDay 2012 Verona
Create your own PHP extension, step by step - phpDay 2012 VeronaCreate your own PHP extension, step by step - phpDay 2012 Verona
Create your own PHP extension, step by step - phpDay 2012 Verona
 
Quick tour of PHP from inside
Quick tour of PHP from insideQuick tour of PHP from inside
Quick tour of PHP from inside
 
PHP7 is coming
PHP7 is comingPHP7 is coming
PHP7 is coming
 

Andere mochten auch

Condor_Group_Enterprises
Condor_Group_EnterprisesCondor_Group_Enterprises
Condor_Group_Enterprises
Jonathan Levy
 
Condor Security Training
Condor Security TrainingCondor Security Training
Condor Security Training
Jonathan Levy
 
Award, Gift and Tax - 10082015
Award, Gift and Tax - 10082015Award, Gift and Tax - 10082015
Award, Gift and Tax - 10082015
Anil P.
 
Samenwerking multipartners
Samenwerking multipartnersSamenwerking multipartners
Samenwerking multipartners
Michael Bertels
 
Articles Do Provide!
Articles Do Provide!Articles Do Provide!
Articles Do Provide!
Anil P.
 
A PROJECT REPORT ON BELT WATCH SYSTEM FOR
A PROJECT REPORT ON BELT WATCH SYSTEM FORA PROJECT REPORT ON BELT WATCH SYSTEM FOR
A PROJECT REPORT ON BELT WATCH SYSTEM FOR
suryakant tripathi
 

Andere mochten auch (16)

Condor_Group_Enterprises
Condor_Group_EnterprisesCondor_Group_Enterprises
Condor_Group_Enterprises
 
Condor Security Training
Condor Security TrainingCondor Security Training
Condor Security Training
 
Award, Gift and Tax - 10082015
Award, Gift and Tax - 10082015Award, Gift and Tax - 10082015
Award, Gift and Tax - 10082015
 
Samenwerking multipartners
Samenwerking multipartnersSamenwerking multipartners
Samenwerking multipartners
 
Training Meldkamer MWB
Training Meldkamer MWBTraining Meldkamer MWB
Training Meldkamer MWB
 
Curve van ellende
Curve van ellendeCurve van ellende
Curve van ellende
 
Passende brandweerzorg bij automatische meldingen VOOR DE VEILIGHEIDSREGIO
Passende brandweerzorg bij automatische meldingen VOOR DE VEILIGHEIDSREGIOPassende brandweerzorg bij automatische meldingen VOOR DE VEILIGHEIDSREGIO
Passende brandweerzorg bij automatische meldingen VOOR DE VEILIGHEIDSREGIO
 
Articles Do Provide!
Articles Do Provide!Articles Do Provide!
Articles Do Provide!
 
Tinea kruris zilla
Tinea kruris zillaTinea kruris zilla
Tinea kruris zilla
 
Hari kantin sekolah
Hari kantin sekolahHari kantin sekolah
Hari kantin sekolah
 
A PROJECT REPORT ON BELT WATCH SYSTEM FOR
A PROJECT REPORT ON BELT WATCH SYSTEM FORA PROJECT REPORT ON BELT WATCH SYSTEM FOR
A PROJECT REPORT ON BELT WATCH SYSTEM FOR
 
Referencing made easy
Referencing made easy Referencing made easy
Referencing made easy
 
partition of pakistan india
partition of pakistan indiapartition of pakistan india
partition of pakistan india
 
MULTILEVEL INVERTER AND NEURAL NETWORK INTRODUCTION
MULTILEVEL INVERTER AND NEURAL NETWORK INTRODUCTIONMULTILEVEL INVERTER AND NEURAL NETWORK INTRODUCTION
MULTILEVEL INVERTER AND NEURAL NETWORK INTRODUCTION
 
Incident met zonnepanelen
Incident met zonnepanelenIncident met zonnepanelen
Incident met zonnepanelen
 
Multilevel inverter fault detectiion classification and diagnosis
Multilevel inverter fault detectiion classification and diagnosisMultilevel inverter fault detectiion classification and diagnosis
Multilevel inverter fault detectiion classification and diagnosis
 

Ähnlich wie php questions

Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Tekblink Jeeten
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
burasyacob012
 
Top 100 PHP Interview Questions and Answers
Top 100 PHP Interview Questions and AnswersTop 100 PHP Interview Questions and Answers
Top 100 PHP Interview Questions and Answers
Vineet Kumar Saini
 
Nt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language AnalysisNt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language Analysis
Nicole Gomez
 

Ähnlich wie php questions (20)

Php interview questions with answer
Php interview questions with answerPhp interview questions with answer
Php interview questions with answer
 
PHP Interview Questions for Freshers 2018
PHP Interview Questions for Freshers 2018PHP Interview Questions for Freshers 2018
PHP Interview Questions for Freshers 2018
 
100 PHP question and answer
100 PHP  question and answer100 PHP  question and answer
100 PHP question and answer
 
Introduction to PHP OOP
Introduction to PHP OOPIntroduction to PHP OOP
Introduction to PHP OOP
 
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
Top 100-php-interview-questions-and-answers-are-below-120816023558-phpapp01
 
Php interview questions
Php interview questionsPhp interview questions
Php interview questions
 
Php interview questions
Php interview questionsPhp interview questions
Php interview questions
 
Oss questions
Oss questionsOss questions
Oss questions
 
Php interview questions
Php interview questionsPhp interview questions
Php interview questions
 
Php Interview Questions
Php Interview QuestionsPhp Interview Questions
Php Interview Questions
 
Php interview-questions and answers
Php interview-questions and answersPhp interview-questions and answers
Php interview-questions and answers
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
 
Unit 1
Unit 1Unit 1
Unit 1
 
Top 100 PHP Interview Questions and Answers
Top 100 PHP Interview Questions and AnswersTop 100 PHP Interview Questions and Answers
Top 100 PHP Interview Questions and Answers
 
1000+ php questions
1000+ php questions1000+ php questions
1000+ php questions
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
Fnt Software Solutions Pvt Ltd Placement Papers - PHP Technology
Fnt Software Solutions Pvt Ltd Placement Papers - PHP TechnologyFnt Software Solutions Pvt Ltd Placement Papers - PHP Technology
Fnt Software Solutions Pvt Ltd Placement Papers - PHP Technology
 
GTU MCA PHP Interview Questions And Answers for freshers
GTU MCA PHP  Interview Questions And Answers for freshersGTU MCA PHP  Interview Questions And Answers for freshers
GTU MCA PHP Interview Questions And Answers for freshers
 
PHP Unit-1 Introduction to PHP
PHP Unit-1 Introduction to PHPPHP Unit-1 Introduction to PHP
PHP Unit-1 Introduction to PHP
 
Nt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language AnalysisNt1310 Unit 3 Language Analysis
Nt1310 Unit 3 Language Analysis
 

Kürzlich hochgeladen

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 

Kürzlich hochgeladen (20)

%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 

php questions

  • 1. 1. Who is the father of PHP ? Rasmus Lerdorf is known as the father of PHP. 2. What is the difference between $name and $$name? $name is variable where as $$name is reference variable like $name=sonia and $$name=singh so $sonia value is singh. 3. What are the method available in form submitting? GET and POST 4.How can we get the browser properties using PHP? <?php echo $_SERVER[‘HTTP_USER_AGENT’].”nn”; $browser=get_browser(null,true); print_r($browser); ?> 5. What Is a Session? A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests. Sessions are commonly used to store temporary data to allow multiple PHP pages to offer a complete functional transaction for the same visitor. 6. How can we register the variables into a session? <?php session_register($ur_session_var); ?> 7. How many ways we can pass the variable through the navigation between the pages? Register the variable into the session Pass the variable as a cookie Pass the variable as part of the URL
  • 2. 8. How can we know the total number of elements of Array? sizeof($array_var) count($array_var) 9. How can we create a database using php? mysql_create_db(); 10. What is the functionality of the function strstr and stristr? strstr() returns part of a given string from the first occurrence of a given substring to the end of the string. For example:strstr("user@example.com","@") will return "@example.com". stristr() is idential to strstr() except that it is case insensitive. 11. What are encryption functions in PHP? CRYPT(), MD5() 12. How to store the uploaded file to the final location? move_uploaded_file( string filename, string destination) 13. Explain mysql_error(). The mysql_error() message will tell us what was wrong with our query, similar to the message we would receive at the MySQL console. 14. What is Constructors and Destructors? CONSTRUCTOR : PHP allows developers to declare constructor methods for classes. Classes which have a constructor method call this method on each newly-created object, so it is suitable for any initialization that the object may need before it is used. DESTRUCTORS : PHP 5 introduces a destructor concept similar to that
  • 3. of other object-oriented languages, such as C++. The destructor method will be called as soon as all references to a particular object are removed or when the object is explicitly destroyed or in any order in shutdown sequence. 15. Explain the visibility of the property or method. The visibility of a property or method must be defined by prefixing the declaration with the keywords public, protected or private. Class members declared public can be accessed everywhere. Members declared protected can be accessed only within the class itself and by inherited and parent classes. Members declared as private may only be accessed by the class that defines the member. 16. What are the differences between Get and post methods. There are some defference between GET and POST method 1. GET Method have some limit like only 2Kb data able to send for request But in POST method unlimited data can we send 2. when we use GET method requested data show in url but Not in POST method so POST method is good for send sensetive request 17. What are the differences between require and include? Both include and require used to include a file but when included file not found Include send Warning where as Require send Fatal Error 18. What is use of header() function in php ? The header() function sends a raw HTTP header to a client.We can use herder() function for redirection of pages. It is important to notice that header() must be called before any actual output is seen. 19. List out the predefined classes in PHP?
  • 4. Directory stdClass __PHP_Incomplete_Class exception php_user_filter 20. What type of inheritance that PHP supports? In PHP an extended class is always dependent on a single base class,that is, multiple inheritance is not supported. Classes are extended using the keyword 'extends'. 21. How can we encrypt the username and password using php? You can encrypt a password with the following Mysql>SET PASSWORD=PASSWORD("Password"); We can encode data using base64_encode($string) and can decode using base64_decode($string); 22. What is the difference between explode and split? Split function splits string into array by regular expression. Explode splits a string into array by string. For Example:explode(" and", "India and Pakistan and Srilanka"); split(" :", "India : Pakistan : Srilanka"); Both of these functions will return an array that contains India, Pakistan, and Srilanka. 23. How do you define a constant? Constants in PHP are defined using define() directive, like define("MYCONSTANT", 100); 24. How do you pass a variable by value in PHP? Just like in C++, put an ampersand in front of it, like $a = &$b; 25. What does a special set of tags <?= and ?> do in PHP? The output is displayed directly to the browser.
  • 5. 26. How do you call a constructor for a parent class? parent::constructor($value) 27. What’s the special meaning of __sleep and __wakeup? __sleep returns the array of all the variables than need to be saved, while __wakeup retrieves them. 28. What is the difference between PHP and JavaScript? javascript is a client side scripting language, so javascript can make popups and other things happens on someone’s PC. While PHP is server side scripting language so it does every stuff with the server. 29. What is the difference between the functions unlink and unset? unlink() deletes the given file from the file system. unset() makes a variable undefined. 30. How many ways can we get the value of current session id? session_id() returns the session id for the current session. 31. What are default session time and path? default session time in PHP is 1440 seconds or 24 minutes Default session save path id temporary folder /tmp 32. for image work which library? we will need to compile PHP with the GD library of image functions for this to work. GD and PHP may also require other libraries, depending on which image formats you want to work with. 33. How can we get second of the current time using date function? <?php $second = date(“s”); ?>
  • 6. 34. What are the Formatting and Printing Strings available in PHP? printf()- Displays a formatted string sprintf()-Saves a formatted string in a variable fprintf() -Prints a formatted string to a file number_format()-Formats numbers as strings 35. How can we find the number of rows in a result set using PHP? $result = mysql_query($sql, $db_link); $num_rows = mysql_num_rows($result); echo "$num_rows rows found";