Welcome! Log In Create A New Profile


getting started with variables- Section 2

Posted by floydtshegare 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
getting started with variables- Section 2
July 30, 2013 08:57AM
While constants are defined in php using the function: define () and once defined it can't be changed or undefined. I have learnedVariables are assigned when needed. They also hold numerical or text values. Using variables seems more interesting thus far. $thejourneycontinues_text.
When assigning a variable, words that come after $ sign and ending before the _ can be in any language. e.g $fetola_number=10; is still valid.

At least i can assign variables that are easy to remember. In Sesotho!

lets Go !
Re: getting started with variables- Section 2
July 30, 2013 01:04PM
Hi floydtsheqare,

I felt the same way as you when I finished this section, but every thing has its place. You going
to use define() when it comes to writing the assignment. Don't take anything in the tutorial lightly!

as you say, lets Go!
Re: getting started with variables- Section 2
July 30, 2013 03:19PM
I don't see why you can't name your variables in Sesotho, but I would be wary of classifying your variables as "text" or "number". PHP doesn't require a data type when declaring a variable and PHP can actually convert data into different types, so, a variable that stared off holding an int may become a float or even string of letters.

crh(); function takes a number and returns it's corresponding ascii character as a letter or another number
ord(); function takes a letter and returns it's ascii code

Even chess pieces can be displayed in the browser using ascii codes.
I know the chess pieces are not directly related to PHP but I think they're pretty cool.
Re: getting started with variables- Section 2
September 10, 2013 09:28AM
we declare and assign

$x=4;// numeric datatype
$v='Mdu'; //characters datatype
Sorry, only registered users may post in this forum.

Click here to login