Skip to content

Instantly share code, notes, and snippets.

View solofeed's full-sized avatar
🦁
Working from home

Eugene (Yevhenii) Kuzmenko solofeed

🦁
Working from home
View GitHub Profile
@solofeed
solofeed / store.php
Last active November 16, 2021 19:45
PHP assessment (refactoring and optimisation)
<?php
function store($variable){
$insert = "INSERT INTO `".$variable['table']."`(";
foreach ($variable as $key => $value) {
if(trim($key) != 'table'){
$insert = $insert.''.$key.',';
}
}
$insert = substr($insert,0,-1);
$insert = $insert.") VALUES(";