Crear etiquetas o tags con php
Hola a todos los del foro, les traigo una funcion en php para crear etiquetas al estilo taringa o identi.
function etiqueta($somestring, $urlWeb){ $tagsString = isset($somestring) ? (string)strip_tags($somestring) : ''; if ($tagsString != '') { $tags_array = explode(",", $tagsString); $tags_array = array_unique($tags_array); //no dups, please foreach($tags_array AS $key => $tag) { $tag = trim(stripslashes($tag)); if($tag == '') continue; //skips if empty echo '<a href="'.$urlWeb.'tag/'.url_amigable($tag).'/" rel="tag">'.$tag.'</a>'; } } }
Respuesta #1
gracias por el aporte!!
0
Puntos
Puntos
Por alber hace 101 meses
Administrador