Skip to main content

Using variables:-

 Printing information onto the screen is great, but we don’t always know exactly what information we want to print. While we’re writing our code. For example, if we want to print the visitor’s name, there’s no possible way of knowing that information before they visit. That’s where variables come in variables, are a way to store information in order to reference it later variables can be used to store numbers names or other important data in HP variables must start with a dollar sign followed by a letter or an underscore then an alphanumeric character string. Here’s an example. You see that we have our opening PHP tags, a dollar sign followed by the wordage, and then an equal sign and some value. In this case, 34, and we have our semicolon. Age is a placeholder for the number that we have stored in it. Which is 34 PHP knows age is 34 because of the equal sign,

which means is assigned to or gets, I’ll usually say, gets when referencing variables, we can then use age as if it’s the number 34, printing it or even doing calculations on it, like adding subtracting or multiplying. If we decide later we want to change it, we can do that. Two variables are easier to keep track of you can change the Them on the Fly. And most importantly, like the opening example. Sometimes,
you don’t know, certain information at runtime there are also special variables called constants,
that are defined a little differently. In this case, you would use a function or a keyword called
Define with parentheses around it in the parenthesis. You will have the name of the constant in quotes. And in this case, it’s version then a comma and the You of that constant. Which in this case is 1 Point 1, we can then treat the constant as if it’s a variable without a dollar sign. A
couple of things to note though are that, constants are case sensitive. So if we were to write the version in lowercase here, it would not work. And the important part. The reason that constants are called constants is that they are immutable or can’t be changed at runtime. So if we try to reassign a new value to the version using either the guest’s symbol or the Define function. Again, neither of those will work. Constants are great. If you have some value that you know, you absolutely don’t want to change throughout the run time. In both cases for variables and constants, there are a set of predefined values that we can’t use. These are known as reserved words or predefined variables. So for example we can’t use the word this in a variable assignment. Similarly, we can’t create a constant called PHP
underscore version or some other constants that you see here in the PHP manual. The last important aspect to know about variables right now is that computers are very specific about how different types of data are represented. Words are represented differently than numbers are. And further whole numbers are represented differently than decimal numbers. In programming languages,
you need to tell the computer if you are giving it a word or a number. Luckily, PHP. Handles. For most of this us, we don’t need to declare the kind of data.
Our variables are. Most of the time, PHP will figure out how we want to use it and then do it for
us. This makes PHP a week. A typed language that said there are a few different ways variables can be represented as integers, which are Whole numbers like 0 1 or 45 floats, which are numbers with decimal points. For example, 1.0 or 3.16 characters are single letters, numbers, or symbols,
It’s worth noting a few things about characters. The first is that numbers with and without quotes are handled differently, you can do calculations with the integer one, but not the character one, which is represented by quotes around the number one. It’s also worth noting that capital letters are considered different from lowercase letters. So, a capital, A, and a lowercase,
a are considered different by PHP. This is why you are able to use upper and lowercase letters in your passwords to make them more secure.

The last two variable types. Here are strings which are a collection of characters such as hello or racer 5. And billions can have only one of two values, true or false. Now there is
one more type of variable and that’s called an array of arrays are collections or sets of any of the previously mentioned variable types. And you’ll learn a lot more about those while integers.
Floats and boolean’s can be written without the use of quotes strings and characters must be placed in quotes. So for example, we have a string with the variable name so we have the name get Joe and we have a variable called first underscore letter. So we have first underscore letter gets
Jay. You’ll notice, I used both single quotes and double quotes in the example above and there are nuanced differences between them. But for assignments, like these, we can use the single and double quotes interchangeably. You may also notice that with the first underscore letter,
there are no space spaces are not allowed in variable names. And often multi-word variables will replace spaces with an underscore variable.
Are extremely important. As part of working with PHP, you will use them for storing and retrieving
data and it will make writing complex programs much easier.

Comments

Popular posts from this blog

Best digital marketing in Perth

Best digital marketing in Perth Introduction Your introduction into the brave new world of the digital space will be custom-tailored to your business needs requirements. You will be introduced to the crew who will be handling your project, from inception to the launch into the market. Assess It will be our job to not only know your customers but how they engage with the core products and  brand relationships . From here we break down what we research, to identify the core elements needed to engage the customer. Create It’s imperative that the design of your vessel is done right from the start. Its shape, level of focus, and attention to detail are crucial for a prosperous, lucrative, and extended journey. We will always present concepts and suggestions as per the requirement, but we truly believe this process should be a collaborative one between the creative crew of the PWD and the client. The final form will dictate its progression into the  development  and manufacturing of your new

WHAT ARE NEURAL NETWORKS? | Comingfly

WHAT ARE NEURAL NETWORKS ? Neural Networks the process of machine learning are neural networks. These are brain-inspired networks of interconnected layers of algorithms, called neurons, that feed data into each other, and which can be trained to carry out specific tasks by modifying the importance attributed to input data as it passes between the layers. During training of these neural networks, the weights attached to different inputs will continue to be varied until the output from the neural network is very close to what is desired, at which point the network will have 'learned' how to carry out a particular task. A subset of machine learning is deep learning, where neural networks are expanded into sprawling networks with a huge number of layers that are trained using massive amounts of data. It is these deep neural networks that have fueled the current leap forward in the ability of computers to carry out task like speech recognition and computer vision. T he

Happiness is luck | Comingfly

 ** How to Always Choose Happiness.   1. Determine What Happiness Means to You “The greatest discovery of any generation is that a human can alter his life by altering his attitude.” 2. Understand How Happiness Works for You “Happiness is not a feeling it’s an action. In order to feel happy you have to do happy.” 3. Choose to Be Around the Right People “The people you surround yourself with influence your behaviors, so choose friends who have healthy habits.”    4. Commit to Helping Others “The purpose of life is not to be happy. It is to be useful, to be honorable, to be compassionate, to have it make some difference that you have lived and lived well.” 5. Choose to Take Care of You – Mind Body and Spirit “Self-care is a deliberate choice to gift yourself with people, places, things, events, and opportunities that recharge our personal battery and promote whole health—body, mind, and spirit.”  

body-fitness Important of life | Comingfly

body-fitness Important of life In general, a strong candidate for the "best" title will be any easy-to-learn exercise that targets multiple muscle groups and gives you the practical strength and muscle tone to meet your fitness goals. Exercises that don't require fancy, expensive equipment earn extra credit. Here are seven of the best exercises for athletes and fitness junkies looking for a simple and effective full-body workout.

why we use Numpy in python

  why we use NumPy in python NumPy  is a general-purpose array-processing package. It provides a high-performance multidimensional array object and tools for working with these arrays. It is the fundamental package for scientific computing with  Python .  A powerful N-dimensional array object. Syntex:-   import  numpy arr = numpy.array([ 1 ,  2 ,  3 ,  4 ,  5 ]) print (arr)     Output:-   [1 2 3 4 5] NumPy  is a basic level external library in Python  used  for complex mathematical operations.  NumPy  overcomes slower executions with the  use  of multi-dimensional array objects. It has built-in functions for manipulating arrays. We can convert different algorithms to can into functions for applying on arrays.   NumPy  arrays are faster and more compact than Python lists. An array consumes less memory and is convenient to  use .  NumPy uses  much less memory to store data and it provides a mechanism of specifying the data types.