- function_exists: documentation ( source)
<?php
$product = array('material', 'britelki', 'chaschka', 'kostochki', 'vkladish', 'zastejka');
if( !function_exists('create_from_variable') ){
function create_from_variable($arr){
foreach($arr as $key){
create_function('',"; $gc_".$key." = 123; echo '<p>$gc_".$key."</p>';");
}
}
}
create_from_variable($product);