Understanding PHP Variable Scope

php-scope

In PHP as in other programming languages, scope identifies areas in a program or script where a given variable is visible. There are many scope rules and here are the most important ones.

  • The native super globals can be viewed anywhere in the program.
  • Constants can be used outside as well as inside functions, i.e., they have global visibility.
  • When you define a global variable in a script, that variable will have visibility in all areas of that script except for inside of functions within that same script.

What a Constant is and how to declare one

What a Constant is and how to declare one

In PHP values that are stored in variables are updated all the time. What happens when you need a value to maintain consistency though? For that you can use constants. Similar to how we can assign a value to a variable, we also assign a value to a constant but the difference is that once you set that constant value, it cannot be modified. Let’s say you want to be sure the values of certain variables will not change in your application.…

Introduction to PHP – Variables and Data Types

We’ve covered a bunch of front end design and programming in some recent posts a la, twitter bootstrap. What about minding the back end? When we talk back end, we talk PHP. What is PHP? It’s a cool programming language efficient in many ways used to communicate with a database, generate sessions and cookies, drum up unique content to serve to a browser, and even interact with third party API’s or Application Programming Interfaces.…

What’s Next For Bootstrap

whats-next-for-bootstrap

What’s Next For Bootstrap

My twitter bootstrap post is currently getting major traction here at the great Vegi Bit so why not ride that bandwagon and talk about what’s coming up for the next iteration of the wonderful twitter bootstrap framework.

First off, the next version of bootstrap is going to be Mobile First. What does that mean? It means all your fancy shmancy smartphones and tablets are growing their web traffic at a much faster clip than desktop driven traffic and therefore, the creators have decided to focus on where the growth is.…

How to Learn Cisco Networking

how to learn cisco networkingCisco Powers the Internet

The internet is made up of millions of computers. When you think of computers, you probably think of the Desktop PC your reading this on or the Server hosting this website. It’s true, this is part of the internet. What you may or may not know depending on your technology background, is that in between the servers and clients are computers in the middle that connect them all together.…