Answers for "php string take part"

PHP
5

php get part of string

substr ( $string , $start , $length  );

/**Returns the extracted part of string;
  *or FALSE on failure, or an empty string
  */
Posted by: Guest on April-03-2020
1

php string take part

<?php
$str = "Africa Beautiful!";
echo substr($str, 0, 6);  // Outputs: Africa
echo substr($str, 0, -10); // Outputs: Beautiful
echo substr($str, 0);     // Outputs: Africa Beautiful!
?>
Posted by: Guest on May-23-2021

Browse Popular Code Answers by Language