You are here: Re: check string contents: can be used as var? « PHP Programming Language « IT news, forums, messages
Re: check string contents: can be used as var?

Posted by Oliver Saunders on 10/18/05 21:09

> Just out of curiosity, why do you want to do this?


I'm seeing if I can create my own form abstraction classes. When you do
something like this:

$surname = new osisField;
$surname->SetName('surname');

I want setname to SetName() to be able to check to see if its parameter
can be used as a valid <input name=""> and post variable.

Thinking about it you can use any key for an array can't you. So
$_POST['45##'] is a valid key but then you can't extract() that. (See
test below)

<?
$foo = array('##56' => 'data'); // valid
echo $foo['##56']; // valid
echo extract($foo); // returns 0 variables extracted
echo $bar = '##56';
echo $$bar; // unsurprisingly undefined
?>

 

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

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