Depends on why you want to lop it down to a single line? Is this to make your
code tidier, or to improve execution time (the latter I doubt, as it won't
take long to perform the code you describe!).
The neat solution would obviously be a function (maybe even in javascript!)
that takes the parameters date1 and date2 and does the following: -
if $date1 > $date2 {
$sql_date1 = $date1;
$sql_date2 = $date2;
}
else {
$sql_date1 = $date2;
$sql_date2 = $date1;
}
"Asendorf, John" wrote:
> Is there a single line of code to do the following?
>
> I'm trying to interchange two variables' contents... I can do it with the
> following, but I was just wondering... I can't find it if there is...
>
> $a = "abc";
> $b = "def";
>
> $temp = $b;
> $b = $a;
> $a = $temp;
>
> //now $a = "def" and $b = "abc"
>
> Thanks in advance,
>
> John
>
> ---------------------
> Founder of
> The 'What Kind of Idiot Uses PHP with IIS with Oracle on NT?' Consortium
>
> Members: John Asendorf, Thomas Kryger, Florian Clever, Ron Woods, Bod
>
> John Asendorf - [EMAIL PROTECTED]
> Web Applications Developer
> http://www.lcounty.com - NEW FEATURES ADDED DAILY!
> Licking County, Ohio, USA
> 740-349-3631
>
> Vah! Denuone Latine loquebar? Me ineptum. Interdum modo elabitur.
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]