I have a php code as shown below.
php code:
$beta_lists = array_flip($flip);
print_r($beta_lists); // Line A
foreach ($beta_lists as $title => $permalink) {
$title_char = substr(transliterator_transliterate('Any-Latin;Latin-ASCII;', $title), 0, 1);
}
Line A prints the following arrary:
Array
(
[Apple] => http://www.abc.mno/apple/
[Ball] => http://www.abc.mno/ball/
[Builders] => http://www.abc.mno/builders/
[Bowling] => http://www.abc.mno/bowling/
[Correct] => http://www.abc.mno/correct/
[Campaign] => http://www.abc.mno/compain/
[Direct] => http://www.abc.mno/direct/
[Degree] => http://www.abc.mno/degree/
)
What I am trying to achieve through the php code above is I want to count (which is 4 in the following case) the title character while grouping array results in alphabetical order. I will be grouping array results in alphabetical order later.
A C
Apple Correct
B Compaingn
Ball D
Builders Direct
Bowling Degree
Problem Statement:
I am wondering what changes I should make in the php code above so that it counts the total number of title characters (which is 4) used while grouping array results in alphabetical order.