Tejas Rana
  • Home
  • About
  • Experience
  • Skills
  • Blogs
  • Technology
  • Contact
June 10 2015

Show limited words in PHP from string with HTML tags

tejas Infi MVC, PHP

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 […]

June 10 2015

SEO friendly URL generator

tejas Infi MVC, PHP

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] = ‘-‘; […]

Categories

  • .NET
  • Android
  • Angular
  • CakePHP
  • CSS
  • Devops
  • Drupal
  • Infi MVC
  • iOS
  • Javascript
  • Magento
  • Meteor
  • MongoDB
  • Opencart
  • Other
  • PHP
  • Python
  • Ruby
  • Tips & Tricks
  • WordPress

Recent Posts

  • Simplify Product Filtering by Category and Store ID in the Admin Panel with Our Powerful OpenCart 3.x Free Extension
  • Opencart 3.x Set currency based on user’s IP [Free Extension]
  • Anatomy of A Coronavirus-Proof Business[Infographic]
  • Opencart 3 Social Login Extension [FREE]
  • What is NGRX and Use of NGRX

Recent Comments

  • Nilesh on What is State Management in Angular? How to improve Performance?
  • Dinesh on Use Magento If You’re Serious About eCommerce
  • Virendra on Use Magento If You’re Serious About eCommerce
  • Tejas Rana on Show limited words in PHP from string with HTML tags
  • nadim on Show limited words in PHP from string with HTML tags
Tejas Rana
© Tejas Rana 2025