default type of data in $_POST array?

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
Markto
Forum Newbie
Posts: 22
Joined: Thu Nov 17, 2011 1:13 pm

default type of data in $_POST array?

Post by Markto »

If I get some numbers (like 1234) in a $_POST variable (like $_POST['postdata']) through a form field that could collect any character, does the data in $_POST['postdata'] have a default character type? Is it a string, or an integer? (Could it be boolean if I put in "true" or "false" into the field?)

I just want to know if all post data's type is a string or if it depends on what the user entered. I know I can set the type, but I want to know what the default type is.
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: default type of data in $_POST array?

Post by twinedev »

All values are assigned as strings. To verify this, you can do var_dump($_POST);

-Greg
Post Reply