Warning: include(../lntop.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/settype.html on line 19

Warning: include() [function.include]: Failed opening '../lntop.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/settype.html on line 19

Warning: include(../levoe_menu.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/settype.html on line 46

Warning: include() [function.include]: Failed opening '../levoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/settype.html on line 46



Учебник РНР
НазадВперёд

settype

(PHP 3, PHP 4)

settype - устанавливает тип переменной.

Описание

bool settype (mixed var, string type)

Устанавливает тип type переменной var.

Возможные значения type:

  • "boolean" (или, начиная PHP 4.2.0, "bool")

  • "integer" (или, начиная PHP 4.2.0, "int")

  • "float" (только начиная с PHP 4.2.0; для более старых версий используйте не рекомендуемый вариант "double")

  • "string"

  • "array"

  • "object"

  • "null" (начиная с PHP 4.2.0)

Возвращает TRUE при успехе; иначе возвращает FALSE.

Пример 1. settype()
$foo = "5bar"; // string
$bar = true;   // boolean

settype($foo, "integer"); // $foo теперь 5   (integer)
settype($bar, "string");  // $bar теперь "1" (string)

См. также gettype(), приведение типов и трюки с типами.


Назад Оглавление Вперёд
serialize Вверхstrval


Warning: include(../pravoe_menu.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/settype.html on line 149

Warning: include() [function.include]: Failed opening '../pravoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/settype.html on line 149

Rambler's Top100
© 2009 Тест скорости интернета |  Boont.Ru

Warning: include(../lnbottom.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/settype.html on line 275

Warning: include() [function.include]: Failed opening '../lnbottom.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/settype.html on line 275