PHP mb_strcut() Function Last Updated : 07 May, 2023 Comments Improve Suggest changes Like Article Like Report The mb_strcut() is an inbuilt function in PHP that returns a portion of a multi-byte string based on a specified length and starting position. Syntax: mb_strcut( $string, $start, $length $encoding ): stringParameters: This function takes four parameters that are described below. $string: The multi-byte string to extract a portion from.$start: The zero-based index at which to start the extraction.$length: The maximum number of characters to extract. If not provided or set to null, the function extracts all characters from the starting position to the end of the string.$encoding: The character encoding of the string. If not provided, internal encoding is used.Return Value: The mb_strcut() function returns the string which is specified by the start and length parameters. Example 1: The following program demonstrates the mb_strcut() function. PHP <?php $str = "Hello, world!"; $portion = mb_strcut($str, 7); echo $portion; ?> Output: world! Example 2: The following program demonstrates the mb_strcut() function. PHP <?php $str = "Geeks for Geeks"; $portion = mb_strcut($str,5, 7); echo $portion; ?> Output: for Ge Reference: https://www.php.net/manual/en/function.mb-strcut.php Comment More infoAdvertise with us Next Article PHP mb_strcut() Function neeraj3304 Follow Improve Article Tags : PHP PHP-function PHP-Multibyte-String Similar Reads PHP mb_strstr() Function The mb_strstr() function is an inbuilt function in PHP that finds the first occurrence of a given string in the main string, i.e. it will search for the occurrence of the first needle in haystack, & id found then the portion of the haystack will be returned, otherwise return false. Syntax: mb_st 2 min read PHP mb_stristr() Function The mb_stristr() is an inbuilt function in PHP that is used to get the first occurrence of a string within another string. It will check case insensitivity. Syntax:mb_stristr( $haystack, $needle, $before_needle, $encoding = null ): string|falseParameters: This function accepts 4 parameters that are 2 min read PHP mb_strrichr() Function The mb_strrichr() function is a case-insensitive in-built function. This function searches a multi-byte string for the last occurrence of a specified character and returns the portion of the string. Syntax: mb_strrichr( $haystack, $needle, $before_needle , $encoding) : string|falseParameters:Â This f 2 min read PHP mb_strpos() Function The mb_strpos() function is an inbuilt function in PHP that finds the position of string occurrence in the string. Syntax: mb_strpos( $haystack, $needle, $offset, $encoding ): int|falseParameters: This function accepts 4 parameters that are described below: $haystack: This parameter is the main stri 2 min read PHP mb_strlen() Function The mb_strlen() is an inbuilt PHP function that returns the string length in an integer. Syntax: mb_strlen($string, $encoding ): intParameters: This function accepts 2 parameters that are described below: $string: The string parameter whose lengths need to be determined. It is a required parameter.$ 1 min read Like