This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Busca las urls (http://..., www...) y direcciones de correo electrónico dentro de un texto | |
y los rodea con los tags <a> correspondientes. | |
*/ | |
function activar_links($text){ | |
$text = preg_replace("/(^|[\n ])([\w]*?)([\w]*?:\/\/[\w]+[^ \"\n\r\t<]*)/is", | |
"$1$2<a href=\"$3\" >$3</a>", $text); | |
$text = preg_replace("/(^|[\n ])([\w]*?)((www)\.[^ \"\t\n\r<]*)/is", | |
"$1$2<a href=\"http://$3\" >$3</a>", $text); | |
$text = preg_replace("/(^|[\n ])([\w]*?)((ftp)\.[^ \,\"\t\n\r<]*)/is", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$fn = explode('.', $_FILES['archivo']['name']); | |
$ext = array_pop($fn); | |
if($ext == 'zip'){ | |
$files = array(); | |
$zip = new ZipArchive(); | |
if( $zip->open($_FILES['archivo']['tmp_name']) ){ | |
for($i=0; $i<$zip->numFiles; $i++){ | |
$file = $zip->statIndex($i); | |
$files[] = $file['name']; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validaRut(campo){ | |
if ( campo.length == 0 ){ return false; } | |
if ( campo.length < 8 ){ return false; } | |
campo = campo.replace('-','') | |
campo = campo.replace(/\./g,'') | |
var suma = 0; | |
var caracteres = "1234567890kK"; | |
var contador = 0; |