What is Data Type in PHP?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pankajdeoria
Forum Newbie
Posts: 15
Joined: Thu Mar 12, 2009 10:58 am
Location: Bangalore,India

What is Data Type in PHP?

Post by pankajdeoria »

Please Tell me
What is Data Type in PHP?
Thank You.

Pankaj Gupta
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: What is Data Type in PHP?

Post by requinix »

It's just like a data type in another language.

What are you asking? That's not a very well-phrased question.
pankajdeoria
Forum Newbie
Posts: 15
Joined: Thu Mar 12, 2009 10:58 am
Location: Bangalore,India

Re: What is Data Type in PHP?

Post by pankajdeoria »

Can you please explain me the definition of data type with examples.
Thank You.

I am very new. You can assume that I do not know anything about Datatype.
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: What is Data Type in PHP?

Post by Mark Baker »

There's a whole section on this in the PHP manual, with lots of examples

Simple data types

Number - something numeric, that you can do sums with, e.g. 666 or 12.345 or even 12.34e-6
There are two types of numbers: integers (which don't have a decimal point like 666) or float (which do have a decimal point like 12.345)

Strings - something that is text like a word or sentence

Booleans - which can have only two possible values like True or False



If you're having trouble understanding these simple data types, then don't worry about more complex types like arrays, objects or resources until you do understand the above
pankajdeoria
Forum Newbie
Posts: 15
Joined: Thu Mar 12, 2009 10:58 am
Location: Bangalore,India

Re: What is Data Type in PHP?

Post by pankajdeoria »

Thank You Mark
Post Reply