Home
Q&A
Education
Technology
Credit
General
Health
Insurance
Questions
Ask a Question
What are the different types of variables present in PHP?
Home
Technology
What are the different types of variables present...
asked
Jul 13, 2021
in
Technology
by
JackTerrance
What are the different types of variables present in PHP?
interview-question-answer
technology-questions-answers
1
Answer
0
votes
answered
Jul 13, 2021
by
JackTerrance
There are 8 primary data types in PHP which are used to construct the variables. They are:
Integers: Integers are whole numbers without a floating-point. Ex: 1253.
Doubles: Doubles are floating-point numbers. Ex: 7.876
Booleans: It represents two logical states- true or false.
NULL: NULL is a special type that only has one value, NULL. When no value is assigned to a variable, it can be assigned with NULL.
Arrays: Array is a named and ordered collection of similar type of data. Ex: $colors = array("red", "yellow", "blue");
Strings: Strings are a sequence of characters. Ex: “Hello InterviewBit!”
Resources: Resources are special variables that consist of references to resources external to PHP(such as database connections).
Objects: An instance of classes containing data and functions. Ex: $mango = new Fruit();
Related questions
0
votes
Q: What are the different types of variables used in shell script?
What are the different types of variables used in shell script?...
asked
May 28, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What are the different types of variables used in shell script?
What are the different types of variables used in shell script?...
asked
Jan 19, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: Mention the different types of variables?
Mention the different types of variables?...
asked
Jan 4, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: Tanushree has created two variables with different data types. Identifythe variable name and data types for the following
Tanushree has created two variables with different data types. Identify the variable name and data types for the following i ... a=4.5 Select the correct answer from above options...
asked
Dec 22, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: IV.Tanushree has created two variables with different data types. Identifythe variable name and data types for the following
IV. Tanushree has created two variables with different data types. Identify the variable name and data types for the ... a=4.5 Select the correct answer from above options...
asked
Dec 22, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: What are Differences between variables and constants in PHP?
What are Differences between variables and constants in PHP?...
asked
Jul 13, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: Combine two PHP variables into one if one variable is not empty
So this is a zany thing that I'm attempting to do, but what I am trying to achieve is querying ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked
Apr 20, 2022
in
Education
by
JackTerrance
php
0
votes
Q: Combine two PHP variables into one if one variable is not empty
So this is a zany thing that I'm attempting to do, but what I am trying to achieve is querying ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked
Apr 20, 2022
in
Education
by
JackTerrance
php
0
votes
Q: What are different tables and default database present in MySQL?
What are different tables and default database present in MySQL?...
asked
Nov 22, 2020
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What are the different environment variables in QTP?
What are the different environment variables in QTP?...
asked
Oct 19, 2020
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
+1
vote
Q: Can variables belonging to different scope have same name in C Programming? If so show an example ?
Can variables belonging to different scope have same name in C Programming? If so show an example ?...
asked
Nov 9, 2020
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: _________ generate summary statistics of different variables in the data frame, possibly within strata.
_________ generate summary statistics of different variables in the data frame, possibly within strata. (a) rename ( ... R Programming Select the correct answer from above options...
asked
Feb 15, 2022
in
Education
by
JackTerrance
r
programming
0
votes
Q: Write a JAVA program to store the marks of any 5 subjects in different variables. Calculate total and average. Display the name of the student, total and average. DO NOT USE ANY INPUT METHOD
Write a JAVA program to store the marks of any 5 subjects in different variables. Calculate total and average. ... ANY INPUT METHOD Select the correct answer from above options...
asked
Dec 22, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a JAVA program to store the marks of any 5 subjects in different variables. Calculate total and average. Display the name of the student, total and average.
Write a JAVA program to store the marks of any 5 subjects in different variables. Calculate total and average. ... total and average. Select the correct answer from above options...
asked
Nov 30, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: What are the different types of Blockchain?
What are the different types of Blockchain?...
asked
Jan 22, 2023
in
Technology
by
JackTerrance
blockchain-interview-questions
...