<?php
$str = <<< EOB
/** preloader colors **/
@preloader_bg: #0081ff;
@preloader_color: #fff;
/** layout **/
@body_bg_image_position: ~'left top';
@body_bg_image_repeat: ~'no-repeat';
@body_bg_image_cover: ~'auto';
@body_bg_image: ~'';
EOB;
preg_match_all("~^@([^:]+):\s*([^;]+;?)$\K~m", $str, $matches);
var_dump($matches);
- Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
- array(3) {
[0]=>
array(6) {
[0]=>
string(0) ""
[1]=>
string(0) ""
[2]=>
string(0) ""
[3]=>
string(0) ""
[4]=>
string(0) ""
[5]=>
string(0) ""
}
[1]=>
array(6) {
[0]=>
string(12) "preloader_bg"
[1]=>
string(15) "preloader_color"
[2]=>
string(22) "body_bg_image_position"
[3]=>
string(20) "body_bg_image_repeat"
[4]=>
string(19) "body_bg_image_cover"
[5]=>
string(13) "body_bg_image"
}
[2]=>
array(6) {
[0]=>
string(8) "#0081ff;"
[1]=>
string(5) "#fff;"
[2]=>
string(12) "~'left top';"
[3]=>
string(13) "~'no-repeat';"
[4]=>
string(8) "~'auto';"
[5]=>
string(4) "~'';"
}
}
- Output for 8.3.5
- Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
array(3) {
[0]=>
array(6) {
[0]=>
string(0) ""
[1]=>
string(0) ""
[2]=>
string(0) ""
[3]=>
string(0) ""
[4]=>
string(0) ""
[5]=>
string(0) ""
}
[1]=>
array(6) {
[0]=>
string(12) "preloader_bg"
[1]=>
string(15) "preloader_color"
[2]=>
string(22) "body_bg_image_position"
[3]=>
string(20) "body_bg_image_repeat"
[4]=>
string(19) "body_bg_image_cover"
[5]=>
string(13) "body_bg_image"
}
[2]=>
array(6) {
[0]=>
string(8) "#0081ff;"
[1]=>
string(5) "#fff;"
[2]=>
string(12) "~'left top';"
[3]=>
string(13) "~'no-repeat';"
[4]=>
string(8) "~'auto';"
[5]=>
string(4) "~'';"
}
}
preferences:
193.16 ms | 403 KiB | 291 Q