- print_r: documentation ( source)
- preg_split: documentation ( source)
<?php
$strings = [
"Pizza 'PizzaName' this is a certain pizza",
"Pizza 'NamePizza' this is a certain pizza",
"Pizza 'Hawaii' this is a certain pizza",
"Pizza 'Pepperoni' this is a certain pizza",
"Pizza is a very nice pizza"
];
foreach ($strings as $string) {
print_r(preg_split("~[^']+'[^']+'\K ~", $string));
}