<?php $tests = [ (object) ['content' => 'one, two three four five, six seven'], (object) ['content' => 'foo'], (object) ['content' => 'fee fi, foe, fum, gimme those beans dude'], (object) ['content' => 'one a b c, two d e f g, three h, four i j, five k l m, six n, seven o p, eight q, nine r s t, ten u v w x, eleven y and z'], ]; foreach ($tests as $metakw) { preg_match_all( '/(?:^|, *\K)[^, ]+(?: *[^, ]+){0,2}/', $metakw->content, $matches, ); var_dump( array_slice($matches[0], 0, 10) ); echo "\n---\n"; }
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`