You are here: Re: strval $_REQUEST « PHP Programming Language « IT news, forums, messages
Re: strval $_REQUEST

Posted by Erwin Moller on 05/16/07 18:17

jmark@fastermail.com wrote:

> I have seen some code like
> $value = strval($REQUEST['value']);
>
> I would like to know what is the use of strval here since $_REQUEST
> values are strings?

Hi,

$_REQUEST values might as well contain arrays.

Consider this form:
<form action="test.php" Method="POST">
<input type="checkbox" name="bla[]" value="1">1<br>
<input type="checkbox" name="bla[]" value="2">2<br>
<input type="checkbox" name="bla[]" value="3">3<br>
</form>

When receiving $_POST["bla"] it contains an array.

The programmer wanted to make sure it is a string.

Regards,
Erwin Moller

PS: I think you should avoid $_REQUEST. Just use $_POST and $_GET.

 

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

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