php.org PHP Logo
Beginner Intermediate Advanced

Search results for: "truncate"

How can the floor function in PHP be used to truncate decimal numbers?

To truncate decimal numbers in PHP, you can use the floor() function which returns the largest integer less than or equal to a given number. This func...

In what situations should the TRUNCATE command be used instead of DROP TABLE in PHP MySQL queries for better performance and efficiency?

The TRUNCATE command should be used instead of DROP TABLE when you want to remove all rows from a table but keep the table structure intact. This is m...

Can you provide an example of how to truncate a string in PHP to a maximum of 300 characters?

When working with strings in PHP, it is common to need to truncate a string to a certain length, such as 300 characters. This can be achieved by using...

How can substr() be used in PHP to truncate text effectively?

When truncating text in PHP, the substr() function can be used effectively to limit the number of characters displayed. By specifying the starting poi...

What are some common methods in PHP to truncate text for display on a website, similar to the "Read More" feature in WordPress?

One common method in PHP to truncate text for display on a website is to use the `substr` function to limit the number of characters shown. Another me...

Showing 11 to 15 of 258 results

‹ 1 2 3 4 5 6 7 8 9 10 ... 51 52 ›
PHP.ORG

A free knowledge base for PHP developers. Open to all.

Legal

  • About
  • Contact / Imprint
  • Terms
  • FAQ

© 2025 php.org. All rights reserved.