Single VS Double - RMB Scripting
You appear not to have an account with us, Click HERE to register an account...
RMB Scripting
Navigation
  Home
  Contact
  FAQ
  Forum
  Topsites
  Members
  Affiliates
  Arcade <-- New!
  IoxHost
Downloads
  Templates
  Scripts
  Fonts
  Image Sets
  Software
  Other
 
Tutorials
  .htaccess
  Photoshop
  C/C++
  CSS
  Macromedia Flash
  MySQL
  PHP
  PHP - User System
  HTML
  Javascript
  Macintosh
  Macromedia Fireworks
  Visual Basic
  Visual C#
  Windows
  Python
  Other
 
Latest Tutorials
RMB User Commenting Sy...
Easy Navigation Integr...
Decorate Basic Icon
paragraph shortner
Convert Email address ...
Latest Comments
Badge System
Pet system
Pet system
Badge System
Report & Warn Script
Stats
Total Members: 597 [241]
Total Tutorials: 284
Newsest User: andrerds
Todays Unique Hits: 96
Users Online: 0
 
8 Guests
Poll
What do you look for in a web host?
Price
Uptime
Reviews
Customer Service
Size of Company
Main Content
Tutorial: Single VS Double By whalleyboi09
To Run The Code Says It All
It just shows the different outcome from single or doubles quotations

if you had
$123 = 321;
echo "$123";
That Would Print
321
but if you had

$123 = 321
echo '$123';
it would print
$123

See Simple :D

   
CODE:

<?php
// Single & Double Quotation's
// Whalleyboi09 (C) 2010
// Learn The Up's And Down's Of Single And Double Quotation

// This Is A Part Not To Worry About Its Just An Example
$quantity = 30;
$price = .39;
$taxrate = .05;

// Calculate Total
$total = $quantity * $price;
$total = $total + ($total * $taxrate); // calculate and add tax
$total = number_format ($total, 2);

// This Is Where The Magic Happends
echo 'Using Single Double Quotation Marks <br>';
echo "You are Purchasing <b>$quantity</b> apple(s) at a cost of <b>\$$price</b> Each.
With tax, the total comes to <b>\$$total</b>";

echo "<hr>";

echo 'Using Single Single Quotation Marks <br>';
echo 'You are Purchasing <b>$quantity</b> apple(s) at a cost of <b>\$$price</b> Each.
With tax, the total comes to <b>\$$total</b>';
?>


Questions Comments Below
Request // Suggestions PM Me

Difficulty: Easy
Views: 230
Rating:
Comments
Posted on Friday 26th February 2010 at 07:05 PM
ShadowMage
Just a quick note, variables can't be numbers.
ex: $123abc
Posted on Monday 1st March 2010 at 01:39 AM
whalleyboi09
yeah i forget about that when i posted it but thanks for the comment for other people
Notice:
Remember to post long codes on our pastbin! - (http://rmb.pastebin.com/)
Add Comment
You must be logged in to post a comment.
Good Afternoon Guest
Username: 
Password: 
Remember Username
Links
RMB Arcade
$2.50 Resellers
Free Domains
Free Games
Affiliates