You are here: Re: Trying to get constant from array but get literal string instead « PHP Programming Language « IT news, forums, messages
Re: Trying to get constant from array but get literal string instead

Posted by comp.lang.php on 10/11/40 11:53

bobzimuta wrote:
> comp.lang.php wrote:
> > [PHP]
> > var $filterArray = array('reverse' => IMG_FILTER_NEGATE,
> > 'edge highlight' => IMG_FILTER_EDGEDETECT,
> > 'emboss' => IMG_FILTER_EMBOSS,
> > 'gaussian blur' => IMG_FILTER_GAUSSIAN_BLUR,
> > 'blur' => IMG_FILTER_SELECTIVE_BLUR,
> > 'sketchy' => IMG_FILTER_MEAN_REMOVAL);
> >
> > [/PHP]
> >
> > I am trying to generate an HTML dropdown from this array, however, when
> > I do, the value that should go in the OPTION tag literally becomes
> > this:
> >
> > [quote]
> > <option value="IMG_FILTER_EMBOSS">emboss</OPTION>
> > [/quote]
>
> Are you using PHP 5? Those are PHP 5 constants, and if they don't exist
> the constant will be converted to that string. Just try var_dump(
> IMG_FILTER_NEGATE ); via command line or in a script to see if the
> numeric value is returned. Otherwise, I'd try wrapping the constants
> like the following
> 'reverse' => intval( IMG_FILTER_NEGATE ),


Thanx but I am using PHP 4.1.2 on one machine, PHP 4.3.2 on another
machine, PHP 4.3.9 on another machine and PHP 5.0.4 on another machine,
all test machines for building a portable web application product. So
I can't have anything specific to PHP 5.0+ without having to come up
with a PHP 4+ version, and I can't imagine a version for that, so I'm
scrapping the whole filter thing.

Thanx though
Phil

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация