28, May 2012
how to swap two variables in one line - webmaster forum
Navigation
Webdigity Services
Pagerank Monitor
Whois Tool
Web Design Gallery
Webmaster Forums
Webmaster Directory
Tutorials Database
Webmaster Forums
WebDigity Community
Topsites network news ...
Forum Contests
Forum Lounge
New Member Introductions
Tech News
User Forums
aStatSpam forum
Computers
3rd-Party Scripting
Leet Link Directory
The 100 Lists Website ...
Design and Layout
Newbie webmaster
Graphics & Multimedia
Adobe Photoshop
Macromedia Flash & Act...
Web Page Design
HTML & XHTML
CSS
Accesibility issues
Website & Graphic Revi...
Web Development
PhP
ASP & .NET
Java & JSP
Official Java News
JavaScript
XML - XSLT
Databases
MySQL
Security
Web hosting talk
Hosting companies
Domain names
Configuring your server
Apache web server
Marketing your site
CPC programs
Chitika eMiniMalls
CPM programs
Affiliate programs & o...
Web site promotion
Promotion techniques
Search Engine Optimiza...
Google SEO
Promoting & building a...
Marketplace
Advertise your services
Sell your site
Sell a domain name
Request services
Hire people
Link trading requests
[
Home
|
Help
|
Search
|
Forum's Shop
|
Archive
|
Login
|
Register
|
Webmaster Directory
]
Web
www.webdigity.com
Hide the search bar
Whois database search :
Domain :
Use the whois database tool to retrieve information on any top level domain you are interested in.
Webdigity Webmaster Forums
>
Web Development
>
PhP
Topic:
how to swap two variables in one line
« previous
next »
Pages: [
1
]
Author
Topic: how to swap two variables in one line (Read 1826 times)
Cyberpunk Wannabe
Gender:
Posts: 39
172 credits
Members referred : 0
«
on:
Sep 13, 2005, 09:25:46 pm »
I know this is a nerd thing, but here it is :
Code:
<?php
$a
=
30
;
$b
=
50
;
$a
= (
$a
+
$b
) - (
$b
=
$a
);
echo
$a
.
" "
.
$b
;
?>
It works only with numeric variables.
I am a metal monkey!
Administrator
Community Supporter
?
Jedai Sword Master
Gender:
Posts: 5799
46391 credits
Members referred : 3
«
Reply #1 on:
Sep 14, 2005, 11:23:02 am »
Hehe. Cool
Trial and Error my two best teachers
Join us @ facebook
or
twitter
Last blog :
Butterfly Marketing 2.0
Novice Spammer
Posts: 100
103 credits
Members referred : 0
«
Reply #2 on:
Sep 27, 2005, 11:00:02 am »
Hahah thats tight.
I wish I was an Oscar winner
Posts: 86
247 credits
Members referred : 0
«
Reply #3 on:
Oct 03, 2005, 12:44:23 am »
Hehe. It sounds like a geek joke
Very smart
Global Moderator
Internet Junkie
Gender:
Posts: 1525
6359 credits
Members referred : 8
Gimme all your cookies!!!
«
Reply #4 on:
Oct 03, 2005, 04:41:35 pm »
But that is 4 lines of code!
Only teasing... great stuff!
web directory
|
Affiliate Directory
Last blog :
Canonical URL Links / Tags
I wish I was an Oscar winner
Posts: 86
247 credits
Members referred : 0
«
Reply #5 on:
Oct 03, 2005, 04:47:17 pm »
Quote from: wineo on Oct 03, 2005, 04:41:35 pm
But that is 4 lines of code!
Only teasing... great stuff!
Actually it is only one : $a = ( $a + $b ) - ( $b = $a );
Global Moderator
Internet Junkie
Gender:
Posts: 1525
6359 credits
Members referred : 8
Gimme all your cookies!!!
«
Reply #6 on:
Oct 03, 2005, 04:57:04 pm »
HAHA... I know! I was teasing...
<?php
1. $a = 30;
2. $b = 50;
3. $a = ( $a + $b ) - ( $b = $a );
4. echo $a . " " . $b;
?>
Sorry if my sense of humour is a bit corny, you'll get to know me! I also stir a lot too.
web directory
|
Affiliate Directory
Last blog :
Canonical URL Links / Tags
I wish I was an Oscar winner
Posts: 86
247 credits
Members referred : 0
«
Reply #7 on:
Oct 03, 2005, 05:00:57 pm »
Hehehe. This was a rushed post.
Next time I will read more carefully, and I will sleep more at night
Trackback URI for this entry :
http://www.webdigity.com/trackback.php?topic=210
Bookmark this thread :
Digg
Del.icio.us
Dzone
more....
Pages: [
1
]
Webdigity Webmaster Forums
>
Web Development
>
PhP
Topic:
how to swap two variables in one line
« previous
next »
Jump to:
=>Personal Messages
=>My Subscriptions
=>Profile Settings
=>Account Settings
=>Look and Layout Settings
=>Unread Posts
=>Unread Replies To My Posts
=>Affiliate Program
=>Forum's Shop
=>Arcade
Category: WebDigity Community
=> HumanWorks network news & feedback
===> Clickbank Contextual Script Support
=> Forum Contests
=> Forum Lounge
===> New Member Introductions
===> Tech News
===> Google Forum
=> User Forums
Category: Design and Layout
=> General webmaster discussions
=> Graphics & Multimedia
===> Adobe Photoshop
===> Macromedia Flash & Actionscript
=> Web Page Design
===> HTML & XHTML
===> CSS
===> Accesibility issues
=> Website & Graphic Reviews
Category: Web Development
=> PhP
===> PHP classes @finalwebsites.com
=====> Easy PHP Upload
=====> Access_user Class
=====> Validate_fields Class
=====> DB_cart Class
=====> Miscellaneous scripts or snippets
=====> PHP Whois script
=====> 3rd party modifications
===> Php User Class
=> JavaScript
=> Databases
===> MySQL
=> Security
=> Miscellaneous Languages
===> ASP & .NET
===> Java & JSP
=====> Official Java News
Category: Web hosting talk
=> Hosting companies
=> Domain names
=> Configuring your server
===> Apache web server
Category: Monetizing your site
=> General Business
=> CPC programs
===> Adsense
===> Chitika eMiniMalls
=====> Official news from Chitika
=====> Ad placement reviews
=====> eMiniMalls feedback and suggestions
=> CPM programs
=> Affiliate programs & other revenue models
Category: Web site promotion
=> Promotion techniques
=> Search Engine Optimization
===> Google SEO
=> Promoting & building a forum
===> SMF moding & promoting
Category: Marketplace
=> Advertise your services
===> Web Hosting Deals
=> Sell your site
=> Sell a domain name
=> Request services
=> Hire people
=> Link trading requests
User Area
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 28, 2012, 08:29:57 am
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Donate to our community, and get a permanent link back to your site!
Forum Statistics
Total Posts:
62.852
Total Topics:
11.033
Total Members:
21.457
Tutorials
:
58
Resources
:
929
Designs
:
395
Latest Member:
kenyon
116 Guests, 2 Users online :
Googlebot
,
jackandrew
22 users online today:
jackandrew
,
charles0029
,
SEO AUS
,
Maximlis
,
blackmilk
,
zoii
,
ketnoimang
,
mabdwasoft
,
jackson12
,
rashmimaharjan
,
Kim_smith
,
iplaytheme
,
bjland5
,
Nikolas
,
sobbin
,
skbj329
,
w66266507
,
nathan.joshua
,
bizwiz
,
john12
,
champion118
,
asifreza
Recent topics
Re: What age is perfect, fo...
Avoid Common SEO Mistakes w...
Re: Do you like fishing?...
Re: difference b/w oracle a...
Re: Join webdigity @ facebo...
Re: What are you doing when...
Imperial moving for movers ...
Can i add backlink while do...
HumanWorks Network
Technology news
Webmaster articles
Sublime web directory
RSS Feed directory and viewer
Web Design Gallery
·
Whois Lookup
·
Pagerank
·
Tag Browsing
·
Lo-fi version
·
Syndication
·
Webmaster forum history
·
Advertise
Developed by
HumanWorks
© 2005 - 2012
Webdigity webmaster community
·
sublime directory
Webdigity Webmaster Forums | Powered by
SMF 1.0.12
. © 2001-2005,
Lewis Media
. All Rights Reserved.