Created
December 2, 2014 15:30
-
-
Save phenix-factory/474366d92cba45775052 to your computer and use it in GitHub Desktop.
Implode les saisies de type data pour les inserer dans la base de donnée
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function saisie_implode_array($saisies, $blacklist = array()) { | |
foreach($saisies as $index => $saisie){ | |
// Si on trouve une clée datas il faut implode | |
if ( | |
array_key_exists ('datas', $saisie['options']) // est-ce qu'il y a des data ? | |
and is_array(_request($saisie['options']['nom'])) // Il faut que ce soit un tableau | |
and !in_array($index, $blacklist) // Si c'est dans la blacklist on touche pas | |
) { | |
set_request($saisie['options']['nom'], implode(',', _request($saisie['options']['nom']))); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment