Reply to Re: Trying to get constant from array but get literal string instead

Your name:

Reply:


Posted by bobzimuta on 11/30/64 11:53

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 ),

[Back to original 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

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