Short Text in PHP
This is a function for Short Text and you are using this function.
<?php function shorter($text, $chars_limit) { // Check if length is larger than the character limit if (strlen($text) > $chars_limit) { // If so, cut the string at the character limit $new_text = substr($text, 0, $chars_limit); // Trim off white space $new_text = trim($new_text); // Add at end of text ... return $new_text . "..."; } // If not just return the text as is else { return $text; } } ?> This code is for Display you page. <?php echo shorter($row['database filed name'],105) ?>
Author: Learn Tutorials Point
We Well organized and easy-to-understand Interactive tutorials With lots of examples of how to use Tutorials WordPress, PHP, Bootstrap, Bootstrap 4, HTML, CSS, AJAX, jQuery, Woocommerce, Post, Database, Javascript, Theme, Responsive, Templates.
Trending Posts
Tags
ACF
Ading custom columns
admin
Bootstrap
Cart Price
categories
Change Price
class
Code
comments
Create
Creating custom post Type
CSS
current
custom
Customizing
Custom Post
Custom Post Type
Custom Taxonomy
database
Date
Fatch
form
function
HTML
Image
Install
javascript
jQuery
Menu
PHP
Post
Post Type
Price
product
responsive
Resular price
Single product
Table
taxonomy
Theme
Title
woocommerce
Wordpress
Wordpress Code