The keys filter returns the keys of an array. It is useful when you want to iterate over the keys of an array.
{% set sizes = [34, 36, 38, 40, 42] %}
{% for key in sizes|keys %}
{{ key }}
{% endfor %}
Output
0
1
2
3
4
Warta Lab is one of the best websites for tutorials on PHP, Drupal, Drupal 8, and general programming topics. Visit us for expert solutions, in-depth guides, and valuable programming knowledge
A number can be written in reverse order. For example 12345 = 54321 <?php $ num = 23456; $ revnum = 0; while ($ num > 1) { $...
1 comment:
Post a Comment