Explorar o código

Add files via upload

Daniele Bonini (皮夕): WebDev, DevOps and homomm.org by lots of Simplicity bits %!s(int64=3) %!d(string=hai) anos
pai
achega
bc61476de5
Modificáronse 1 ficheiros con 17 adicións e 0 borrados
  1. 17 0
      Private/functions/funct.inc

+ 17 - 0
Private/functions/funct.inc

@@ -576,3 +576,20 @@ function sendSMS($post_body, string $url, string $username, string $password) {
   return $output;
 }
 }
+
+
+if (!function_exists("str_phrase_reverse")) {
+/**
+ * Reverse the words in the given phrase
+ * 
+ * @param string $string the string being reversed
+ * @return string the resulting reversed string
+ */
+function str_phrase_reverse(string $string): string 
+{
+  settype($aWords, "array");
+  $aWords = explode(PHP_SPACE, $string);
+  $aWords = array_reverse($aWords);
+  return implode(PHP_SPACE, $aWords);
+}
+}