Variable function in php in hindi

आज हम php के इस आर्टिकल में variable in php and variable define rules in hindi और example के साथ समझंगे की local variable , global variable तथा static variable क्या होते हैं कैसे define करते है with example.

what is variable in hindi

variable किसी भी programming language [जैसे java, .Net, c programming language, c++, php आद ] का fundamental block होता हैं.

Variable को किसी भी प्रोग्रामिंग language में value को store करने के लिए use किया जाता हैं यानी की variable container की तरह होता जिसमे value store की जाती हैं  [integer,string, boolean] को store  कर सकते हैं .तथा  variable को प्रोग्राम में कंही भी as reference और मैनीपुलेशन के लिए   use कर सकते हैं. variable की value change भी हो सकती हैं.

इनको भी पढ़े

  • Introduction of software Engineering in hindi
  • HDFS- [Distributed file system] feature and goals [in hindi]

किसी भी variable के दो attribute होते हैं

How to write a variable Name

  1. variable का नाम meaningful होना चाहिए. जैसे Total कोई variable का नाम हैं इसके नाम से ही पता चल रहा हैं इसमें total  value store होंगी.
  2. php में किसी variable का नाम “$” sign से स्टार्ट होता हैं उसके बाद variable का नाम देना होता हैं. जैसे – “$name”.
  3. php में variable का name letter तथा underscore “_” से सटार्ट होता हैं.
  4. आप variable का name किसी number से start नहीं कर सकते हैं तथा php में underscore के बाद भी number use नही कर सकते हैं.
  5. php में कोई भी variable alpha , numeric तथा underscore का combination होता हैं.
  6. php में variable case sensitive होते हैं.
        1. जैसे – “$name” तथा “$NAME” ये दोनों अलग-अलग हैं 

Write way

  • $firstname
  • $_firstname
  • $first_name
  • $first-name
  • $firstName
  • $firstname99

Wrong way

  • $first name
  • $99firstname
  • $first%name

php loosely typed language

  • php एक loosely type language हैं जिसमे हमको कोई भी variable को data type देने की requirement नहीं होती हैं. क्योकि php automatically variable को convert करता हैं particular data type के अंदर.
  • other language में जैसे [c, c++ java] आदि में हमको variable के आगे data type define करना होता हैं. क्योकि ये सभी language  strongly typed language होती हैं .

php variable Scope in hindi

  • php में आप variable को script में कंही में declared कर सकते हो.
  • php script में variable को कंही में access कर सकते हो.
  • अगर आप variable को function के अंदर define करते हो वो आपका local variable होता हैं.
  • अगर variable को function के बाहर define करते हो वो GLOBAL variable होता हैं.
  • आप local function में variable को function में define कर सकते हो और प्रोग्राम में उसकी value change नहीं कर सकते हो.
  • function के अंदर आप GLOBAL variable के access नहीं कर सकते हैं.
  • अगर आपको function के अंदर  GLOBAL variable access करना हैं तो आपको variable के आगे GLOBAL लिखना होगा. 

GLOBAL variable    

local variable

एक example देखते की local variable कैसे define करते हैं.

Static variable

  • जब function का execution complete हो जाता हैं तब उस variable life ख़त्म हो जाती हैं.
  • अगर हमने कोई variable static define किया हैं तो उस variable की life extant हो जाती हैं. तथा उस variable को script में कंही भी access किया जा सकता हैं. click

इनको भी पढ़े

  • color CRT [cathode ray tube] monitor kya and ये कैसे color create करता हैं.
  • type of big data in hindi | big data के प्रकार हिंदी में
  • Characteristics of cloud computing in hindi tutorial

आशा  करता हूँ  variable define rules in hindi, local variable , global variable तथा static variableआपको  समझ में गया होगा . अगर आपको इससे related कोई question पूछना हैं तो आप comment करके पूछ सकते है . हम आपकी comment का जबाब जरुर देंगे . अगर हमारे द्वारा दी गयी जानकारी अच्छी लगी हो तो हमे comment करके जरुर बताये और आपका हमको कोई सुझाब हो तो उसे भी जरुर बताये . दोस्तों आपसे एक request हैं . आप इस जानकारी को आपने दोस्तों , रेस्तेदारो के साथ जरुर शेयर करे | धन्यबाद

What is variable function PHP?

If name of a variable has parentheses [with or without parameters in it] in front of it, PHP parser tries to find a function whose name corresponds to value of the variable and executes it. Such a function is called variable function. This feature is useful in implementing callbacks, function tables etc.

What is variable PHP example?

A variable starts with the $ sign, followed by the name of the variable. A variable name must start with a letter or the underscore character. A variable name cannot start with a number. A variable name can only contain alpha-numeric characters and underscores [A-z, 0-9, and _ ]

What is variable in PHP and its types?

Variables can, but do not need, to be declared before assignment. Variables in PHP do not have intrinsic types - a variable does not know in advance whether it will be used to store a number or a string of characters. Variables used before they are assigned have default values.

What is $_ in PHP?

PHP $_POST is a PHP super global variable which is used to collect form data after submitting an HTML form with method="post". $_POST is also widely used to pass variables.

Chủ Đề