CrazyEngineers
  • query in php

    Updated: Oct 24, 2024
    Views: 848
    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
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Manish Goyal

    MemberSep 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];
    }
    Are you sure? This action cannot be undone.
    Cancel
  • manojsinghrana

    MemberSep 11, 2010

    what is $v in the code above..?
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register