ياجماعة لو سمحتوا انا طالبة مساعدة انا مببتدئة في بي اتش بي وكنت عايزة افهم الكود دة هو في درس
PREDEFINED VARIABLES.
الكود
<?php
function PostGetStr($str,$type){
$VARS = explode(' ',$str);
$RESULT = '';
if($type == 'POST'){
foreach($VARS as $PV) if(isset($_POST[$PV])) {
$RESULT .= "$PV=".trim(strip_tags($_POST[$PV])).'&';
} else {$RESULT .= "$PV=&";}
} elseif($type == 'GET'){
foreach($VARS as $PV) if(isset($_GET[$PV])) {
$RESULT .= "$PV=".trim(strip_tags($_GET[$PV])).'&';
} else {$RESULT .= "$PV=&";}
} elseif($type == 'BOTH'){
foreach($VARS as $PV) if(isset($_REQUEST[$PV])) {
$RESULT .= "$PV=".trim(strip_tags($_REQUEST[$PV])).'&';
} else {$RESULT .= "$PV=&";}
}
$RESULT = substr($RESULT,0,-1);
return $RESULT;
}
?>