<?php
namespace Modules\API\APIInterne\OxaMobility\Outil;

class OxaMobility
{
      
    /**
     * getBodyAndSplitVar
     *
     * @param  mixed $HTTP_RAW_POST_DATA
     * @param  array<mixed> $post
     * @return void
     */
    public static function getBodyAndSplitVar($HTTP_RAW_POST_DATA, &$post)
    {
        
        $HTTP_RAW_POST_DATALLower = strtolower($HTTP_RAW_POST_DATA);
        if (strpos($HTTP_RAW_POST_DATALLower, 'appname')!== false && strpos($HTTP_RAW_POST_DATALLower, 'prgname')!== false && strpos($HTTP_RAW_POST_DATALLower, 'method_oxaproc')!== false) {
            $exp = explode('&', $HTTP_RAW_POST_DATA);
            foreach ($exp as $p) {
                $split = explode('=', $p);
                if ($split[0] == strtolower('content')) {
                    $post['content'] = str_replace('content', '', $p);
                } else {
                    $post[$split[0]] =$split[1];
                }
            }
        }
    }
}
