| .navigation |
|
This function is pretty straight forward. Give a string, and it splits up each character of the string and pushes each character into an array.
I created this function when I had to do specific things to the first and third letter of the given string. (Don't ask). With this function, I can use any character in the string that I'd like.
Usage :
Let's use my name as an example.
$string = "Francisco";
To use this function, simply include the .inc file in the downloadable zip file into the file that you want to use stringtoarray on.
Here's what the code will look like :
$string = "Francisco";
$stringarray = stringtoarray($string);
$stringarray will be indexed as follows :
$string[0] = F
$string[1] = r
$string[2] = a
$string[3] = n
$string[4] = c
$string[5] = i
$string[6] = s
$string[7] = c
$string[8] = o
Francisco Guerra - Site Map - © Fguerra.net 2002-2005