Jump to content



Recommended Posts

I have never seen a double $ used like that. The only time I can think of two $ being used next to each other is if you echoing a US price next to a variable:

$price = "100.00";
echo "The price is \$$price";
Link to comment
Share on other sites

HI thanks i was looking for a date function and found this

works good but i was just curious on what $$ did

[code]function timechange($starttime, $addtime, $add = true) {
        $min = 60;
        $hour = $min * 60;

        $a_time = array('hour', 'min', 'sec');
        $a_addtime = explode(':', $addtime);
        $amount = 0;
        for ($i = 0; $i < count($a_addtime); $i++) {
                $s = $a_time[$i];
                $amount += $$s * $a_addtime[$i];

        $starttime = strtotime($starttime);
        $s = ($add === true) ? date('H:i', $starttime + $amount) : date('H:i', $starttime - $amount);
        return $s;

This will add time to time

[quote]echo timechange('20:50', '01:40');[/quote]

This will minuss time from time

[quote]echo timechange('20:50', '01:40', false);[/quote]

if anyone would like it

Still currious.. ???
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.