متغیرهای از پیش تعریف شده
PHP Manual

$_GET

$HTTP_GET_VARS [نامطلوب]

$_GET -- $HTTP_GET_VARS [نامطلوب]متغیرهای GET HTTP

Description

یک آرایه شرکت‌پذیر که به اسکریپت فعلی از طریق GET در HTTP ارسال شده است.

$HTTP_GET_VARS شامل همان اطلاعات اولیه است اما یک superglobal نیست. (توجه کنید $HTTP_GET_VARS و $_GET متغیرهای متفاوتی هستند و PHP نیز با انها بصورت متفاوت رفتار می‌کند)

Changelog

Version Description
4.1.0 معرفی $_GET موجب نامطلوب شدن $HTTP_GET_VARS شد.

Examples

Example #1 نمونه $_GET

<?php
echo 'Hello ' htmlspecialchars($_GET["name"]) . '!';
?>

با فرض وارد شدن http://example.com/?name=Hannes توسط کاربر

The above example will output something similar to:

Hello Hannes!

Notes

Note:

This is a 'superglobal', or automatic global, variable. This simply means that it is available in all scopes throughout a script. There is no need to do global $variable; to access it within functions or methods.

Note:

متغیرهای GET از طریق urldecode() ارسال می‌شوند.

See Also


متغیرهای از پیش تعریف شده
PHP Manual