Basic PHP Programming Question:

How To Get the Number of Characters in a String?

Tweet Share WhatsApp

Answer:

You can use the "strlen()" function to get the number of characters in a string. Here is a PHP script example of strlen():

<?php
print(strlen('It's Friday!'));
?>

This script will print:

12


Download PHP PDF Read All 139 PHP Questions
Previous QuestionNext Question
How To Convert Strings to Numbers in PHP?How To Remove White Spaces from the Beginning and/or the End of a String in PHP?