<?php $client = (object) ['id' => 1]; $databaseValue = '$client->id $test'; preg_match_all('/^\$(?:[a-z]||[A-Z])\S+/', $databaseValue, $matches); if (!empty($matches)) { $firstVariableOccurance = current(current($matches)); eval("\$value = {$firstVariableOccurance};"); echo "Send command {$value}"; }
You have javascript disabled. You will not be able to edit any code.