3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ["id" => 0, "input_Data" => "Up to 15 Groups / Month"], ["id" => 1, "input_Data" => "Up to 60 CSV File Importing / Month"], ["id" => 2, "input_Data" => "Up to 15 SMTP Config"], ["id" => 3, "input_Data" => "Up to 20 Email Template Can Make"], ["id" => 4, "input_Data" => "Up to 150 Ai Writer Call / Month"], ["id" => 5, "input_Data" => "Markitach SMTP Limit 1000 Emails"] ]; $find = 3; $replace = "Up to the boss"; $index = array_find_key($array, fn($row) => $row['id'] === $find); if ($index !== null) { $array[$index]['input_Data'] = $replace; } var_export($array);
Output for 8.4.1 - 8.4.13
array ( 0 => array ( 'id' => 0, 'input_Data' => 'Up to 15 Groups / Month', ), 1 => array ( 'id' => 1, 'input_Data' => 'Up to 60 CSV File Importing / Month', ), 2 => array ( 'id' => 2, 'input_Data' => 'Up to 15 SMTP Config', ), 3 => array ( 'id' => 3, 'input_Data' => 'Up to the boss', ), 4 => array ( 'id' => 4, 'input_Data' => 'Up to 150 Ai Writer Call / Month', ), 5 => array ( 'id' => 5, 'input_Data' => 'Markitach SMTP Limit 1000 Emails', ), )
Output for 8.1.30 - 8.1.33, 8.2.24 - 8.2.29, 8.3.5 - 8.3.26
Fatal error: Uncaught Error: Call to undefined function array_find_key() in /in/MXbGe:14 Stack trace: #0 {main} thrown in /in/MXbGe on line 14
Process exited with code 255.

preferences:
42.89 ms | 408 KiB | 5 Q