Float data typeįloats are not whole numbers, but rather they are numbers with decimal points. The code above is an example of the integer data type. Integers can either be negative numbers (-34567) or positive numbers (34567). Integers are whole numbers that have no decimal point. Var_dump not only displays your code to your web browser, but also helps you identify what data type you are working with and how many values it contains. In the code above, I used the var_dump keyword to execute my PHP code. We can use another method to run the above code in our web browser. For example: " įrom the code above, the variable values “Derek Emmanuel” and "1234567" are of the string data type because they are enclosed in quotes. A string can also hold numbers and special characters but they should be enclosed in the quotes. Now let's discuss some data types that work with PHP:Ī string is a data type which is represented with some text inside double quotes " ". Variables in PHP store values of different data types. The code above shows the different ways of naming variables in PHP. Here are some examples of naming variables in PHP: " Įcho "$COLOR" //THIS CODE OUTPUTS THE COLOR BLUE TO THE WEB BROWSERĮcho "$_price" //THIS CODE OUTPUTS THE PRICE 1000 TO THE WEB BROWSERĮcho "$_PRICE" //THIS CODE OUTPUTS THE PRICE 900 TO THE WEB BROWSER
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |