Skip to content
  • About Us
  • Contact Us
  • Privacy Policy
  • Disclaimer
  • Corona Virus Stats (Covid-19)
  • Work with us
  • FB
  • LinkedIn
  • Twitter
  • Instagram.com
Tekraze

Tekraze

Dive Into Technology

  • Guides
    • Developer Guide
    • PC Guide
    • Web Guide
    • Android Guide
    • Music
    • Tutorials
  • Feed
    • Tech News
    • Shared Tech
    • Gaming Videos
    • Unboxing videos
  • Forums
    • Android Apps
    • Angular Npm Packages
    • Useful Site Links
    • Tech Queries
    • Windows OS Help
    • Web Guide and Help
    • Android Os And Rooting
    • Jhipster Discussion
    • Git & GitHub forum
    • Open Source Forum
  • Work with us
  • Toggle search form
Variable & its Scope in PHP 1

Variable & its Scope in PHP

Posted on January 30, 2018 By RAHUL CHANANA 2 Comments on Variable & its Scope in PHP

In the last tutorial I have guided you through the Installation Procedure of XAMPP, Now we will discuss variable and its scope. But before that, if you have not seen the previous posts Introduction to PHP & How to install PHP.

What is Variable?

In mathematical terminology, a variable is an entity that can vary or have different values in a different state. In the contrast of variable with the mathematical world, a variable is an entity that could change and store some identifiers and constants. So it is more like a container.

Creating / Declaring PHP Variables:

If you are from C or Java background. Whenever you want to use a variable you need to declare it first then only you can use it to store value, but, Since PHP is an interpreted language, so like other interpreted language, the Variable doesn’t need to declare first. Doesn’t it make sense to call variable a container, as in real world, a container can store anything that is capable to be fit inside it, similarly a PHP variable can store anything. A variable in PHP starts with the $ symbol. For Example:

<?php
$name=”Tekraze “;
$Roll_no=27;
$fees=500.80;
echo “These are my Variable: “;
echo $name, $Roll_no,” “, $fees;
?>

OUTPUT: These are my Variable: Tekraze, 27, 500.80

As shown in the above snippet, the three variable created above $name, $Roll_no, $fees will hold the value Tekraze, 27, and 500.80 correspondingly.

Content Protection by DMCA.com
Pages: 1 2 3
Developer Guide, PHP Tutorials, Tutorials, Web Guide Tags:local variable, Loosely typed Language, PHP, static Variable, variable, Variable scope

Post navigation

Previous Post: Workflow of Git
Next Post: IDE’s The Integrated Development Environment you need to know

Related Posts

  • Unlocking the Power of LinkedIn API Banner
    Unlocking the Power of LinkedIn API: A Comprehensive Guide to Automating and Optimizing Your Social Networking Efforts Developer Guide
  • Things you need to know to be a Developer 3
    Things you need to know to be a Developer Developer Guide
  • An Introduction to Application Programming Interfaces (APIs) and Common Apps/Services That Use Them
    An Introduction to Application Programming Interfaces (APIs) and Common Apps Services That Use Them Developer Guide
  • Your IP Address Says More About You Than You Know 4
    Your IP Address Says More About You Than You Know Guest posts
  • Reference Variable in PHP 5
    Reference Variable in PHP PHP Tutorials
  • The Importance of a Virtual Number for Registration | OnlineSim
    The Importance of a Virtual Number for Registration | OnlineSim Web Guide

Comments (2) on “Variable & its Scope in PHP”

  1. Saurabh says:
    April 3, 2020 at 7:20 pm

    Thanks for sharing the informative blog post. I have found here lots of interesting information for my knowledge I need. All the details you provide to us, it was very helpful and useful. Thanks for sharing this amazing post. I appreciate your efforts.
    Check out some latest Shopping Apps

    Reply
    1. Balvinder Singh says:
      April 3, 2020 at 7:24 pm

      Thanks Saurabh, share with others and keep visiting

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Advertisements

Subscribe to updates

Enter your email below to subscribe





Posts by Categories

Advertisements
  • Create Sticker Application for Whatsapp
    How to Create Stickers Application for Whatsapp Developer Guide
  • Types of Programming - Difference you need to know 6
    Types of Programming – Difference you need to know Developer Guide
  • Tekraze Antivirus for Windows 7
    The Best Free Antivirus Software for Windows 7/8/8.1/10 PC Guide
  • DriveDroid - Boot your PC/Laptop from your android device boot os from android tekraze
    DriveDroid – Boot your PC/Laptop from your android device Android Guide
  • MarkUp editor
    MarkUp Editor – A new editor in Town Tech News
  • Text Editors For Code - 2018 7
    Text Editors For Code – 2018 Developer Guide
  • How To install Eclipse IDE - Video 8
    How To install Eclipse IDE – Video Tutorials
  • How to use NPM module with Browserify in the browser
    How to use any NPM module with Browserify in the browser Developer Guide

Affliate Links

Sell with Payhip

Earn with Magenet

Sell and Buy with Adsy

GainRock affiliate Program

Automatic Backlinks

Advertise with Anonymous Ads

accessily tekraze verificationIndian Blog Directory

Copyright © 2023 Tekraze.

Powered by PressBook News WordPress theme