Source Code



Create Tags Using Explode

  • anonymous
  • Dec 17' 13
  • PHP
  • 412
  • 48
  • United States

Pasarkode having tags every source code, in this case we using this function to create a tags from one field in database that separated by comma.

 

the syntax :

<?php 		
   $pisahkan  = explode(",",$r["keyword"]);
    $jkata = (integer)count($pisahkan);
    
    $jkata = $jkata - 1; 
    for ($i = 0; $i <= $jkata; $i++){ 
	   if (strlen($pisahkan[$i])<4){}else{  // tags mush be greater than 4 character
	   echo "<a class="post-tag" href="tag-".$pisahkan[$i].".code">".$pisahkan[$i]."</a>"; } // create a link tags
   }	
 ?>

 

 

  • Tags : tags, explode, link
comments powered by Disqus



Category

Tag Linked