Skip to content
Advertisement

Sort by date function with variable field name

JavaScript

The problem I’m having is passing the variable field_name to the date_compare function, which can only take two variables due to the usort method. date_compare function must also be wrapped in a variable to avoid redeclaring a function if it is called more than once. m I even going about this the right way?

Advertisement

Answer

The PHP construct is use

JavaScript

See https://www.php.net/manual/en/functions.anonymous.php

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement