3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $search = 'Hello %% World'; $searchArray = explode(' ', $search); var_dump($searchArray); echo rtrim(str_repeat('title LIKE ? OR ', count($searchArray)), ' OR '); $parameters = array_map(function($value) { return $value . '%'; }, $searchArray); var_dump($parameters);
based on DSuRP
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.6
array(3) { [0]=> string(5) "Hello" [1]=> string(2) "%%" [2]=> string(5) "World" } title LIKE ? OR title LIKE ? OR title LIKE ?array(3) { [0]=> string(6) "Hello%" [1]=> string(3) "%%%" [2]=> string(6) "World%" }