Sort array using array_multisort() with dynamic number of arguments/parameters/rules/data

You could try to use call_user_func_array. But I’ve never tried it on a built-in function before. Here is an example: $dynamicSort = “$sort1,SORT_ASC,$sort2,SORT_ASC,$sort3,SORT_ASC”; $param = array_merge(explode(“,”, $dynamicSort), array($arrayToSort)) call_user_func_array(‘array_multisort’, $param)

How to split a string into words. Ex: “stringintowords” -> “String Into Words”?

Let’s assume that you have a function isWord(w), which checks if w is a word using a dictionary. Let’s for simplicity also assume for now that you only want to know whether for some word w such a splitting is possible. This can be easily done with dynamic programming. Let S[1..length(w)] be a table with … Read more