skip to Main Content

Sort array values by their existence in a blacklist array, then alphabetically – PHP

I have the following code: $check = array('person a','person c'); $data = array('person c','person a','person d','person e'); define('check',$check); //asort($data); print'<pre>';print_r($data);print'</pre>'; usort($data,function($a,$b){ return empty(check[$a]) ? 1 : $a <=> $b; }); print'<pre>';print_r($data);print'</pre>'; exit; What I am trying to achieve is: person…

VIEW QUESTION

Send timestamp array parameter to PostgreSQL function

i have developed a pgplsql function to receive array of dates the return the maximum date, but its not able to call the function: select 1, arcfm.array_max_date('{2022-02-03, 2022-06-05}'::timestamp[]) as max_date_time; CREATE OR REPLACE FUNCTION arcfm.array_max_date(in dates_array timestamp[])     RETURNS timestamp     LANGUAGE…

VIEW QUESTION
Back To Top
Search