Posts Tagged with substr

Displaying 1-2 of 2 results.
Resolved: PHP7 Call to undefined function mb_substr() ubuntu
posted by admin on July 19, 2017
I move my Yii1 from shared hosting, where PHP 5.7 to VDS VPS hosting with PHP7.
And I have got some error

Call to undefined function mb_substr()

Server is Linux with Uvuntu 16.04 OSRead more
Resolved: PHP display an Array under alphabetical letters without key sensitive
posted by admin on April 27, 2016
I have an associative array of tags like

array(11) {
[0]=>
array(4) {
["tag_id"]=>
string(2) "81"
["slug"]=>
string(4) "mag1"
["name"]=>
string(4) "mag1"
["TagsCount"]=>
string(1) "2"
}
[1]=>
array(4) {
["tag_id"]=>
string(2) "85"
["slug"]=>
string(4) "mag2"
["name"]=>
string(4) "mag2"
["TagsCount"]=>
string(1) "1"
}
[2]=>
array(4) {
["tag_id"]=>
string(2) "83"
["slug"]=>
string(4) "mag3"
["name"]=>
string(4) "mag3"
["TagsCount"]=>
string(1) "2"
}
[3]=>
array(4) {
["tag_id"]=>
string(2) "84"
["slug"]=>
string(4) "mag4"
["name"]=>
string(4) "mag4"
["TagsCount"]=>
string(1) "2"
}
. . .
[9]=>
array(4) {
["tag_id"]=>
string(2) "79"
["slug"]=>
string(4) "tag5"
["name"]=>
string(4) "tag5"
["TagsCount"]=>
string(1) "1"
}
[10]=>
array(4) {
["tag_id"]=>
string(2) "80"
["slug"]=>
string(4) "tag6"
["name"]=>
string(4) "tag6"
["TagsCount"]=>
string(1) "1"
}
}

In output I want to see result like

<h3>A</h3>
<ol>
<li>
<em>tag count</em>
<a href="link to tag">Animal</a>
</li>
<li>
<em>tag count</em>
<a href="link to tag">Aqua</a>
</li>
<li>
<em>tag count</em>
<a href="link to tag">Arthur</a>
</li>
</ol>
<!-- if B not EXIST not show B -->
<h3>C</h3>
<ol>
<li>
<em>tag count</em>
<a href="link to tag">Camel</a>
</li>
<li>
<em>tag count</em>
<a href="link to tag">Crazy</a>
</li>
</ol>
<!-- etc -->
Read more