STRING // If a given variable is a string, wrap it with apostrophes. // Otherwise, just return it as given. function string_wrap($value) { if (is_string($value)) { return "'" . $value . "'"; } else { return $value; } } // ARRAY --> ARRAY // 'Wrap' all strings in array with apostrophes. function strings_wrap($array) { return array_map("string_wrap", $array); } // STRING NUMBER --> STRING // Return the nth word of a given string (space-seperated) function word_nth($string, $number) { return explode(" ", $string)[$number]; } ?>