In PHP, how do I slice strings with built-in functions?

In PHP, you can slice strings using built-in functions such as `substr()`, `str_split()`, and `mb_substr()`. These functions allow you to extract parts of a string or divide it into smaller pieces.

Keywords: PHP, string manipulation, substr, str_split, mb_substr
Description: This content provides examples of how to slice strings in PHP using built-in functions.

     Hello [1] => , Wor [2] => ld! )
    print_r($slicedArray);

    // Example of using mb_substr()
    $string = "こんにちは世界"; // "Hello World" in Japanese
    $sliced = mb_substr($string, 0, 5); // Outputs: こんにちは
    echo $sliced;
    ?>
    

Keywords: PHP string manipulation substr str_split mb_substr