By admin , 20 March, 2026 Check the PHP code for compatibility with a specific PHP version php vendor/bin/phpcs -p ./web/modules/custom/ --standard=PHPCompatibility --extensions=module/php,inc/php,install/php,php/php --runtime-set testVersion 8.4 Tags phpcs php
By admin , 28 March, 2024 Convert date to another format $new_date = date('d.m.Y', strtotime($existing_date)); Tags date php
By admin , 17 August, 2023 Remove array item by value $flat_tags = array_diff($flat_tags, [$favorites_tag->id()]); Tags php
By admin , 17 August, 2023 Flat multidimensional array of entity id's $tags = $form_state->getValue('tags'); $flat_tags = []; array_walk_recursive($tags, static function ($a) use (&$flat_tags) { $flat_tags[] = $a; }); // Or simple: $flat_tags = array_column($tags, 'target_id'); Tags entity php array