Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old November 26th, 2012, 02:58 AM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs up variables in php

here is the simple example for declaring variables:

<?php
$txt="Hello World!";
$x=16;
?>

Thank u,

Regards
Srikanth
rxonlineshopee.com
Reply With Quote
  #12 (permalink)  
Old April 30th, 2013, 04:59 AM
Registered User
Points: 24, Level: 1
Points: 24, Level: 1 Points: 24, Level: 1 Points: 24, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2012
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Smile

some of Note for declare a variable
variables in PHP start with a dollar sign ($)
variables' names are case sensitive
you can use alphanumeric characters and underscores (no spaces)
the first character of a string name can be a letter or an underscore (no numbers)
you can assign a value to a variable using the assignment operator (=)
you cannot name a variable $this
if the value is a piece of text (a string) you have to wrap the value in between quotation marks
if the name of the variable contains more than one word, please use lower camel case notation (e.g. $thisIsMyName or $varNameHere)
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Namespace - how to declare? JillB Excel VBA 0 January 25th, 2008 07:11 PM
declare My ajkumar Visual Basic 2005 Basics 0 April 18th, 2007 05:24 AM
HOW DECLARE VARIABLES IN PHP jhan316 Beginning PHP 1 July 25th, 2006 07:16 PM
Can I declare variables visable from every script Makis Beginning PHP 1 January 11th, 2004 02:02 AM
how to declare date variables rehana Beginning PHP 1 December 15th, 2003 05:56 PM



All times are GMT -4. The time now is 11:30 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.