Tema: Reducir
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/08/2016, 01:41
Ramonromero
 
Fecha de Ingreso: enero-2008
Ubicación: Valencia
Mensajes: 65
Antigüedad: 16 años, 3 meses
Puntos: 2
Reducir

Veran, tengo un archivo .php el cual se compone de unas 20 url, ¿hay alguna manera de reducirlo

Código HTML:
<?php

$sin_amonestacion1 = 'url1';

$sin_amonestacion2 = 'url2';

$sin_amonestacion3 = 'url3';

$sin_amonestacion4 = 'url4';
     

$ch = curl_init($sin_amonestacion1);   
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data1= curl_exec($ch);  
curl_close($ch);

$ch = curl_init($sin_amonestacion2);   
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data2= curl_exec($ch);  
curl_close($ch);

$ch = curl_init($sin_amonestacion3);   
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data3= curl_exec($ch);  
curl_close($ch);

$ch = curl_init($sin_amonestacion4);   
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data4= curl_exec($ch);  
curl_close($ch);     

$resultado_no_amonestacion=$data1 . $data2 . $data3 . $data4;

echo $resultado_no_amonestacion;       


?> 
Gracias por responder