www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] strtolower VARIABLE ???

  1. #1
    Join Date
    Jun 2006
    Posts
    204

    resolved [RESOLVED] strtolower VARIABLE ???

    What I have here is all my variables being dumped out of a DB. The VARIABLE comes back all capitals since the DB field name is all caps. I want the variable name to be lowercase... Can this be done?

    PHP Code:
    <?php




    $query_position_information 
    "SELECT * FROM acr_positions_w_equipment where ID = '{$row_new_hire['POSITION']}'";
    if (
    $r_position_information mysql_query ($query_position_information)) {
    while (
    $row_position_information mysql_fetch_array ($r_position_information)) {


    foreach (
    $row_position_information as $key => $value) {
    $key $value;
    }


    echo 
    $POSITION;

    }
    }


    ?>

  2. #2
    Join Date
    Dec 2005
    Posts
    2,984
    PHP Code:
    foreach ($row_position_information as $key => $value) {
    ${
    strtolower($key)} = $value;


  3. #3
    Join Date
    Jun 2006
    Posts
    204
    Perfect!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles