array-unique

    1熱度

    1回答

    創建圖像的URL的數組: $matches = array(); preg_match_all('#(http://[^\s]*?\.jpg)#i',$html, $matches); $matches2 = array_unique($matches); // get unique echo "there are ".count($matches2)." items!"; pri

    0熱度

    2回答

    因此,我有兩個包含家族成員和名稱的關聯數組。每個數組具有相同的索引鍵,但具有不同的值。我需要結合這兩個數組,刪除重複值,而不是重複鍵,然後按字母順序排序。 到目前爲止,我有 Array1 = array( "Grandma"=>"Laurie", "Grandpa"=>"John", "Uncle"=>"Jeff", "Aunt"=>"Julie",

    1熱度

    4回答

    我有對象的multidimensionnal數組中刪除重複的鍵: 0 => array 32281 => object ... 105145 => object ... 165656 => object ... 194124 => object ... 195397 => object ... 205859 => o

    0熱度

    2回答

    我想在我客戶的網站主頁上颳去所有的網址,以便我可以將它遷移到wordpress。問題是我似乎無法得到重複刪除的網址列表。 下面的代碼: $html = file_get_contents('http://www.catwalkyourself.com'); $dom = new DOMDocument(); @$dom->loadHTML($html); // grab all the

    0熱度

    2回答

    我是一個新手到PHP,並一直在尋找解決這個問題不知疲倦(我敢打賭它的一個超級簡單的解決方案太嘆息了)。 我從谷歌文檔導入.csv飼料。它拉動2欄,一欄是「名字」,另一欄是「地點」。我想刪除重複的「地點」。因爲我使用fgetcsv,我的理解是它已經將數據排序到數組中。理想情況下,它將省略「位置」重複項,以便「名稱」看起來好像列在它們對應的「位置」下。 這裏是我有: $url = "https://d

    2熱度

    3回答

    這是一個問題。 我正在用數組中的新行爆炸一個字符列表。並做它獨特的數組。但它沒有按預期工作。下面 是代碼: $list = "test ok test test ok ok test"; $list_explode = explode("\n", $list); //exploding the characters of the list from the input //disp

    38熱度

    1回答

    可能重複: Re-index numeric array keys 我有一個數組如下 Array ( [0] => 15/11/2012 - 18/11/2012 [1] => 15/11/2012 - 18/11/2012 [2] => 15/11/2012 - 18/11/2012 [3] => 15/11/2012 - 18/11/2012

    2熱度

    4回答

    在下面的代碼: $sth = $dbh->query('SELECT DISTINCT title,courseId,location from training'); $sth->setFetchMode(PDO::FETCH_ASSOC); $results = $sth->fetchAll(); $uu = array_unique($results); echo "<pre>";

    12熱度

    4回答

    我有以下變量$行: 陣列( [0] => stdClass Object ( [product_sku] => PCH20 ) [1] => stdClass Object ( [product_sku] => PCH20 ) [2] => stdClass Object ( [product_sku] =>

    0熱度

    1回答

    現在,我有一個返回功能: return array_unique(array_merge($sizes, $custom_sizes)); 我的問題是,某些關鍵可以在一個較低的情況下,和其他大寫。 例如,我可以在$大小得到「縮略圖」和「縮略圖」在$ custom_sizes - 在這種情況下,我當然會想砸一個。 (爲名稱相同的情況: 「星火」 VR 「星球大戰」 VR 「星球大戰」 VR 「星