<?php
$message = "
[xxxStudent.address_1xxx][xxxStudent.address_2xxx][xxxStudent.address_3xxx]
[xxxStudent.townxxx]
[xxxStudent.countyxxx]
[xxxStudent.postcodexxx]
[xxxStudent.country_iso_2xxx]";
preg_match_all('/\[xxx(\w+[\.+\w+]+)xxx\]/', $message, $tags, PREG_SET_ORDER);
var_dump($tags);
- Output for 4.3.0 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 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.6
- array(7) {
[0]=>
array(2) {
[0]=>
string(25) "[xxxStudent.address_1xxx]"
[1]=>
string(17) "Student.address_1"
}
[1]=>
array(2) {
[0]=>
string(25) "[xxxStudent.address_2xxx]"
[1]=>
string(17) "Student.address_2"
}
[2]=>
array(2) {
[0]=>
string(25) "[xxxStudent.address_3xxx]"
[1]=>
string(17) "Student.address_3"
}
[3]=>
array(2) {
[0]=>
string(20) "[xxxStudent.townxxx]"
[1]=>
string(12) "Student.town"
}
[4]=>
array(2) {
[0]=>
string(22) "[xxxStudent.countyxxx]"
[1]=>
string(14) "Student.county"
}
[5]=>
array(2) {
[0]=>
string(24) "[xxxStudent.postcodexxx]"
[1]=>
string(16) "Student.postcode"
}
[6]=>
array(2) {
[0]=>
string(29) "[xxxStudent.country_iso_2xxx]"
[1]=>
string(21) "Student.country_iso_2"
}
}
preferences:
306.98 ms | 407 KiB | 460 Q