there is an array of user_ realname values in the figure. Zhu Fei has duplicates. Now if you want to remove the duplicates, just keep one. How to write this cycle? I am a rookie. I hope my predecessors can give me some advice. no, no, no.
there is an array of user_ realname values in the figure. Zhu Fei has duplicates. Now if you want to remove the duplicates, just keep one. How to write this cycle? I am a rookie. I hope my predecessors can give me some advice. no, no, no.
you can try this opportunistic game
function repeat(array $input, string $key): array
{
$data = [];
foreach ($input as $val) {
$data[$val[$key]] = $val;
}
sort ($data);
return $data;
}
var_dump (repeat ($data, 'user_realname'));
if it is found in the database, use group by user_realname when querying.
if the data is written dead, compare it with the foreach loop and remove it repeatedly with unset ().
if the data is small, it is assumed that the first
is retained.<?php
$arr = [
[
'id_user'=>1,
'user_realname'=>''
],
[
'id_user'=>2,
'user_realname'=>''
],
[
'id_user'=>3,
'user_realname'=>''
],
[
'id_user'=>4,
'user_realname'=>''
],
[
'id_user'=>5,
'user_realname'=>''
],
];
$isExistRealName = [];
$newArr = array_filter($arr, function ($v) use (&$isExistRealName) {
if (!in_array($v['user_realname'], $isExistRealName)) {
array_push($isExistRealName, $v['user_realname']);
return true;
}
return false;
});
var_dump($newArr);
array_unqiue
Previous: Flex layout
description: a regular match is given to the content of an input box, and the matching content is the product activation code. looks like this: "0C31-0B81-BB32-3094-0C31-0B81-BB32-3094 " Code: $( -sharplicenseCode ).keyup(function () { le...
I configured the MIME type of the file with the amr suffix in the apache configuration as application ms-download, Why it is a garbled page when opening a file in amr format using window.open in chrome, while a file in amr format can be successfully dow...
what does the code circled in the following picture mean? ...
adopt a reward of 10 yuan, 1045 Access denied for user root @ localhost (using password:NO) recently, when I was at the front end of my self-study, I came into contact with a little bit of database. This happened when I made a new connection on ...
there is an h5 page embedded in the encapsulated APP. After the function of issuing an order, how can I get the user s id to add the address and place the order ...
A similar question, I want to know how to deal with the number of correct answers. I originally wanted to declare a variable and then decide to add it when the answer is right, but not if it is wrong. But what is printed is always 0 and 1 ....
make an answer system, trigger the click event on the answer page (choose the correct answer), and add 1. No mistakes. Now the whole answer is finished. Jump to another page, that is, the answer completion page, how can I get the value of the correct ans...
use Wechat public platform JSSDK to develop Wechat sharing function! Every time I use the company s public platform account, I report a signature error! There is nothing wrong with the account of the public platform developed by myself! I would like to...
the background gives me an interface to tell me the parameters to be passed, and how to click Save to save the address information entered by the user to the address list ...
when I click the button to select a region, there will be three addresses of provinces, cities and regions. I got the value through .html, but the parameters required by the background are separated by city and county. What do I do with the data segmen...
this is the HTML corresponding to this part ...
in the laravel project, when using the blade template, you often use @ section ( style ) on the page. <style type="text css"> < style> @ endsection or @ section ( script ) <script type="text javascript"> &...
the project uses jq+bscroll.js, because there are some pages that need to show chart data, so echart.js, uses a column chart (the data can slide left and right when the data is too long), resulting in problems with the original page sliding 1 if the f...
to write several mobile pages, you need to use the components provided by ant design mobile to develop. How to use this thing, the document doesn t understand much at first and which of the two ways mentioned above should be used, ah, to find a so...
...
for example, (- 1) get 225 ...
str+= < div class= "mui-input-row mui-radio mui-left " > ; str+= < label > set to default < label > ; str+= < input name= "radio1 " type= "radio " checked class= "moren " id= + data.data [I] .id + > str+= < div > use mui s butt...
when our website is opened on the computer side, Baidu news often appears at the bottom of the page. I don t know what this is caused by, is it the code? Did we drive it on our own initiative? Or are there some problems with the settings of the operato...
console.log (pic) merchandise address this is the address of the printed picture http: www.zhani.com Uploads. $( .tu img ). Attr ( src , +pic+ ); how to put pic into it, ask for great help, try many ways are not correct ...
var uid = users.id; console.log(uid); ID console.log(returnCitySN["cip"]);ip if (uidsand undefined) {} $(function () { page rendering $.ajax ({) type: POST , dataType: "json", url: "URL ", data: {ip:returnCitySN [...