So I have a question. I am currently looking at RedBeanPHP and I like how they can create tables, in development, on the fly and then freeze the schema for production.
I am looking to do something simmilar. Now what Im curious about is if PHP community has built anything where I can do:
$someClass->someFunction('string'); // Gives me back string as the column type.
Or:
$someClass->someFunction(99.0); // Gives me back double
and so on.
Does anything like this exist? I have tried searching and found nothing but you never know. Is there anything built into PHP to do this? I know theres various functions to see if bool, if string and so on, but that doesn't cover all the database column types.
Any help is appreciated
Execute your variable inside
var_dump($varhere);
and it will display what it is. You can do a simple query to ASSOC Array, and then run a for each loop with an var_dump($var); and it will print what it is...will out put the following
Same with
will dump out
I recommend you look at PHP Manual - var_dump()