Re: [PHP] variable type - conversion/checking

2013-03-16 Thread Andrew Ballard
On Sat, Mar 16, 2013 at 12:21 PM, Ashley Sheridan wrote: > > On Sat, 2013-03-16 at 11:46 -0400, Andrew Ballard wrote: > > On Mar 16, 2013 6:14 AM, "Ashley Sheridan" wrote: > > > > On Fri, 2013-03-15 at 22:32 -0400, Andrew Ballard wrote: > >> > >> > Guess regex are the only useful solution here. W

Re: [PHP] variable type - conversion/checking

2013-03-16 Thread Matijn Woudt
On Sat, Mar 16, 2013 at 6:52 PM, Maciek Sokolewicz < maciek.sokolew...@gmail.com> wrote: > Hi, >> >> I have tried to find a way to check if a character string is possible to >> test whether it is convertible to an intger ! >> >> any suggestion ? >> >> BR georg >> > > All responses in this thread h

Re: [PHP] variable type - conversion/checking

2013-03-16 Thread Maciek Sokolewicz
Hi, I have tried to find a way to check if a character string is possible to test whether it is convertible to an intger ! any suggestion ? BR georg All responses in this thread have been very nice; but you could also try a much simpler 2-step check: 1. is_numeric 2. if true > check if the

Re: [PHP] variable type - conversion/checking

2013-03-16 Thread Ashley Sheridan
On Sat, 2013-03-16 at 11:46 -0400, Andrew Ballard wrote: > On Mar 16, 2013 6:14 AM, "Ashley Sheridan" wrote: > > > > On Fri, 2013-03-15 at 22:32 -0400, Andrew Ballard wrote: > >> > >> > Guess regex are the only useful solution here. When you consider to use > >> > built-in functions, just remembe

Re: [PHP] variable type - conversion/checking

2013-03-16 Thread Andrew Ballard
On Mar 16, 2013 6:14 AM, "Ashley Sheridan" wrote: > > On Fri, 2013-03-15 at 22:32 -0400, Andrew Ballard wrote: >> >> > Guess regex are the only useful solution here. When you consider to use >> > built-in functions, just remember, that for example '0xAF' is an integer >> > too, but '42.00' isn't.

Re: [PHP] Type of a variable in PHP

2013-03-16 Thread Norah Jones
Try this function get_type($var) { if(is_object($var)) return get_class($var); if(is_null($var)) return 'null'; if(is_string($var)) return 'string'; if(is_array($var)) return 'array'; if(is_int($var)) return 'integer'; if(is_bool($var

Re: [PHP] Type of a variable in PHP

2013-03-16 Thread Kevin Peterson
Thanks Nora On Fri, Mar 15, 2013 at 4:34 PM, Sebastian Krebs wrote: > > > > 2013/3/15 Kevin Peterson > >> Have two questions - >> 1. How to find type of a variable in PHP. >> > > gettype(), or one of the is_*()-functions. But for me more interesting for > me: Why do you _need_ this? > > >> 2. H

Re: [PHP] PDO Transaction

2013-03-16 Thread Lester Caine
Simon Dániel wrote: 2013/3/15 Lester Caine Simon Dániel wrote: Hi, I have a trouble with PDO transactions. I would like to start using transactions, but I am not familiar with it. I have got a 'There is no active transaction' exception, however, I am using beginTransaction method, and also

Re: [PHP] variable type - conversion/checking

2013-03-16 Thread Ashley Sheridan
On Fri, 2013-03-15 at 22:32 -0400, Andrew Ballard wrote: > > Guess regex are the only useful solution here. When you consider to use > > built-in functions, just remember, that for example '0xAF' is an integer > > too, but '42.00' isn't. > > Shoot...I hadn't considered how PHP might handle hex or

[PHP] FW: No Subject

2013-03-16 Thread Ryan S
http://www.coachholidays.co.uk/ramlm/hfoqauyyvomdvio.kaxkucbebccxpzq

Re: [PHP] PDO Transaction

2013-03-16 Thread Simon Dániel
2013/3/15 Lester Caine > Simon Dániel wrote: > >> Hi, >> >> I have a trouble with PDO transactions. >> >> I would like to start using transactions, but I am not familiar with it. I >> have got a 'There is no active transaction' exception, however, I am using >> beginTransaction method, and also I