note 95905 modified in function.rawurldecode by danbrown

From: Date: Thu, 28 Jan 2010 13:23:56 +0000
Subject: note 95905 modified in function.rawurldecode by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-165430@lists.php.net to get a copy of this message
solution for parsing row post data <?php $strFormData = rawurldecode($_POST['formData']);/* row post data*/ if(isset($strFormData) && !empty($strFormData)) { $arrFormData = explode("&", $strFormData); $intCnt = count($arrFormData); if($intCnt > 0 ) { for($i=0;$i<$intCnt;$i++ ) { $x = explode('=', $arrFormData[$i]); /* if array */ if( strstr( rawurldecode($x[0]), '[') ) { $_POST[str_replace("[]", "", rawurldecode($x[0]))][] = str_replace("+", " ", rawurldecode($x[1])); } else { $_POST[rawurldecode($x[0])] = str_replace("+", " ", rawurldecode($x[1])); } } } } ?> --was-- /* solution for parsing row post data */ $strFormData = rawurldecode($_POST['formData']);/* row post data*/ if(isset($strFormData) && !empty($strFormData)) { $arrFormData = explode("&", $strFormData); $intCnt = count($arrFormData); if($intCnt > 0 ) { for($i=0;$i<$intCnt;$i++ ) { $x = explode('=', $arrFormData[$i]); /* if array */ if( strstr( rawurldecode($x[0]), '[') ) { $_POST[str_replace("[]", "", rawurldecode($x[0]))][] = str_replace("+", " ", rawurldecode($x[1])); } else { $_POST[rawurldecode($x[0])] = str_replace("+", " ", rawurldecode($x[1])); } } } } http://php.net/manual/en/function.rawurldecode.php

« previous php.notes (#165430) next »