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
wartalab.blogspot.com is the best website and blog to provide tutorial for the, PHP, Drupal, Drupal 8 and general topic. Visit for programming knowledge and tutorial and solution
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