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 “星