query in php

manojsinghrana

manojsinghrana

@manojsinghrana-NciZJa Oct 24, 2024

foreach($delete as $key =>$value)

i am not able to get this code. can someone please tell me what this piece of code actually do. Thank you

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Manish Goyal

    Manish Goyal

    @manish-r2Hoep Sep 10, 2010

    It is used in case of associative array,in these type of array each ID key is associated with a value.

    For eg if you want to store price of cars in an array then it will be good idea to store it in this way

    $car=array("Maruti"=>200000,"BMW"=>"100000");
    foreach ($a as $key => $v) {
    echo $car[$key];
    }

  • manojsinghrana

    manojsinghrana

    @manojsinghrana-NciZJa Sep 11, 2010

    what is $v in the code above..?