\ d менее эффективен, чем [0-9]

Im довольно поздно, чтобы вырвать ответ за это, так я всегда делал это, и, честно говоря, он в 100 раз лучше и лучше, чем лучший ответ, я только надеюсь, что кто-то это увидит. И найдите это полезным

    //create an array, we will call it here. 
    $here = array();
    //create an SQL query in order to get all of the column names
    $SQL = "SHOW COLUMNS FROM Table";
        //put all of the column names in the array
        foreach($conn->query($SQL) as $row) {
            $here[] = $row[0];
        }
    //now search through the array containing the column names for the name of the column, in this case i used the common ID field as an example
    $key = array_search('ID', $here);
    //now delete the entry
    unset($here[$key]);
1194
задан Peter Mortensen 22 May 2013 в 21:06
поделиться