Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php string to char array

<?php

$str = "Hey Arkadaş";

$arr1 = str_split($str);
$arr2 = str_split($str, 3);

print_r($arr1);
print_r($arr2);

?>

/*
Rasult:
  Array
(
    [0] => H
    [1] => e
    [2] => y
    [3] =>
    [4] => A
    [5] => r
    [6] => k
    [7] => a
    [8] => d
    [9] => a
    [10] => �
    [11] => �
)
Array
(
    [0] => Hey
    [1] =>  Ar
    [2] => kad
    [3] => aş
)*/
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #php #string #char #array
ADD COMMENT
Topic
Name
5+9 =