Update funciones.php
This commit is contained in:
@@ -219,6 +219,23 @@ function parsea_enlace($txt) {
|
||||
return urlencode($enlace);
|
||||
}
|
||||
|
||||
function acorta_texto($texto, $numeroDePalabras) {
|
||||
// Primero contamos el numero de palabras que hay
|
||||
$arrayPalabrasTexto = explode(" ", $texto);
|
||||
$numeroPalabrasEnTexto = count($arrayPalabrasTexto);
|
||||
// Si el numero de palabras es menor que las palabras del texto, las recortamos y devolvemos
|
||||
if ($numeroDePalabras < $numeroPalabrasEnTexto) {
|
||||
$arrayPalabrasTextoFinal = array();
|
||||
for ($i = 0; $i < $numeroDePalabras; $i++) {
|
||||
array_push($arrayPalabrasTextoFinal, $arrayPalabrasTexto[$i]);
|
||||
}
|
||||
return join(" ", $arrayPalabrasTextoFinal)."...";
|
||||
}else{
|
||||
// Si no, devolvemos el mismo texto
|
||||
return $texto;
|
||||
}
|
||||
}
|
||||
|
||||
function muestra_breadcrumb($record = array(), $previousLinks = array(),$class = "bg-gray-200 p-3 rounded font-sans w-full breadcrumb-v2") {
|
||||
global $TABLE_PREFIX;
|
||||
$enlaces = array();
|
||||
|
||||
Reference in New Issue
Block a user