Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/04/2014, 13:18
p3cn0G
 
Fecha de Ingreso: febrero-2014
Mensajes: 60
Antigüedad: 11 años
Puntos: 0
Que realiza el siguiente codigo PHP?

Hola, estoy analizando codigo PHP y acudo aqui para ver si me pueden aclararlo de la mejor manera posible. Tenemos el siguiente codigo en php:
Código PHP:
<?php
if (!function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  if (
PHP_VERSION 6) {
    
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}
?>
Alguien me podría aclarar de manera mas o menos concisa que ejecuciones o acciones lleva a cabo dicho código? Sería muy de agradecer si me respondiesen :P