News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevShed:
Validating Boolean Values and Float Numbers with Filters in PHP 5
August 06, 2009 @ 07:51:05

Continuing their "validation in PHP" series, DevShed has posted this new tutorial looking at the validation of boolean values and float numbers in PHP5 applications (with the filter extension).

As you learned in previous parts of the series, the filter extension permits you to validate elements of a given array very easily as well. Therefore, in this fourth chapter I'm going to explain how to check for Boolean values in arrays, as well as how to validate float numbers using another handy filter.

the examples are pretty simple, running a filter_var on the values to check if it's a boolean and to require that the set of values comes in as an array.

1 comment voice your opinion now!
tutorial boolean filter extension float


Danne Lundqvist's Blog:
Zend Framework and locales
April 01, 2009 @ 13:44:18

In a new post to his blog Danne Lundqvist take a look at using locales in the Zend Framework and a "gotcha" that made him look deeper.

Last night I spent a couple of hours with Zend Framework and especially Zend_Form. I discovered, and now also reported as ZF-6175, a bug in Zend_Validate_Float when using a locale with a decimal point other than ".". There are unit tests but none that test Zend_Validate_Float under a different locale.

He points out that floats are locale-aware in PHP itself (code examples) and how the current Zend_Validate float package handled it. He has already proposed a fix for the problem and, until its changed in the framework, has provided the simplified code you can use.

0 comments voice your opinion now!
zendframework locales float number zendvalidatefloat


Paul Jones' Blog:
Sanitation with PHP filter_var()
January 17, 2007 @ 15:22:00

In working on a new filter for his Solar framework, Paul Jones discovered that the "float" sanitizer in the new filter extension (PHP 5.2+) doesn't quite work as expected.

I found a problem with the "float" sanitizing function in the 5.2.0 release, and thought others might want to be aware of it. In short, if you allow decimal places, the sanitizer allows any number of decimal points, not just one, and it returns an un-sanitary float.

He includes the text of the bug he submitted as an example of how the error might happen and, despite it being marked bogus, Paul still holds that things are still not working like they should.

You can also check out Pierre-Alain Joye's response to this over on his blog.

0 comments voice your opinion now!
filter extension sanitatinon filtervar float solar framework filter extension sanitatinon filtervar float solar framework



Community Events





Don't see your event here?
Let us know!


list bugfix configure threedevsandamaybe introduction wordpress library project podcast series application code laravel language api framework community interview developer release

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework