Category: Infi MVC

  • Show limited words in PHP from string with HTML tags

    Hi, Here i have create another function called “truncate”. With this function you can show limited words with HTML tags. I know there is a function in PHP “SUBSTR”. but the main issue i face with this is this will also remove HTML tags, which mean when any tag starts then that tags will not…

  • SEO friendly URL generator

    Hi, here is a function which I create for generating SEO friendly URL. first we have to create a function called “friendlyURL”. here is a code <?php function friendlyURL($inputString){ $url = strtolower($inputString); $patterns = $replacements = array(); $patterns[0] = ‘/(&amp;|&)/i’; $replacements[0] = ‘-and-‘; $patterns[1] = ‘/[^a-zA-Z01-9]/i’; $replacements[1] = ‘-‘; $patterns[2] = ‘/(-+)/i’; $replacements[2] = ‘-‘;…