bueno amigos tengo este codigo
Código PHP:
Ver original 'action' => 'create',
'add' => 'Submit',
'username' => $usuario,
'email' => $email,
'passwd' => $pass,
'passwd2' => $pass,
'domain' => $dominio,
'bandwidth' => $row['bandwidth'],
'ubandwidth' => $row['ubandwidth'],
'quota' => $row['quota'],
'uquota' => $row['uquota'],
'vdomains' => $row['vdomains'],
'uvdomains' => $row['uvdomains'],
'nsubdomains' => $row['nsubdomains'],
'unsubdomains' => $row['unsubdomains'],
'ips' => $row['ips'],
'nemails' => $row['nemails'],
'unemails' => $row['unemails'],
'nemailf' => $row['nemailf'],
'unemailf' => $row['unemailf'],
'nemailml' => $row['nemailml'],
'unemailml' => $row['unemailml'],
'nemailr' => $row['nemailr'],
'unemailr' => $row['unemailr'],
'mysql' => $row['mysql'],
'umysql' => $row['umysql'],
'domainptr' => $row['domainptr'],
'udomainptr' => $row['udomainptr'],
'ftp' => $row['ftp'],
'uftp' => $row['uftp'],
'aftp' => $row['aftp'],
'php' => $row['php'],
'spam' => $row['spam'],
'cron' => $row['cron'],
'sysinfo' => $row['sysinfo'],
'catchall' => $row['catchall'],
'cgi' => $row['cgi'],
'ssl' => $row['ssl'],
'ssh' => $row['ssh'],
'userssh' => $row['userssh'],
'oversell' => $row['oversell'],
'dnscontrol' => $row['dnscontrol'],
'dns' => $row['dns'],
'serverip' => $row['serverip'],
'ip' => 'shared',
'notify' => 'yes'
));
es para la API de directadmin, bueno el problema es el siguiente:
Necesito que algunas cadenas se muestren solo si cumplen una condicion.
EJ:
Código PHP:
Ver original 'action' => 'create',
'add' => 'Submit',
'username' => $usuario,
'email' => $email,
'passwd' => $pass,
'passwd2' => $pass,
'domain' => $dominio,
'bandwidth' => $row['bandwidth'],
if(!empty($row['ubandwidth'])){ 'ubandwidth' => $row['ubandwidth'],
}
'quota' => $row['quota'],
'uquota' => $row['uquota'],
'vdomains' => $row['vdomains'],
'uvdomains' => $row['uvdomains'],
'nsubdomains' => $row['nsubdomains'],
'unsubdomains' => $row['unsubdomains'],
'ips' => $row['ips'],
'nemails' => $row['nemails'],
'unemails' => $row['unemails'],
'nemailf' => $row['nemailf'],
'unemailf' => $row['unemailf'],
'nemailml' => $row['nemailml'],
'unemailml' => $row['unemailml'],
'nemailr' => $row['nemailr'],
'unemailr' => $row['unemailr'],
'mysql' => $row['mysql'],
'umysql' => $row['umysql'],
'domainptr' => $row['domainptr'],
'udomainptr' => $row['udomainptr'],
'ftp' => $row['ftp'],
'uftp' => $row['uftp'],
'aftp' => $row['aftp'],
'php' => $row['php'],
'spam' => $row['spam'],
'cron' => $row['cron'],
'sysinfo' => $row['sysinfo'],
'catchall' => $row['catchall'],
'cgi' => $row['cgi'],
'ssl' => $row['ssl'],
'ssh' => $row['ssh'],
'userssh' => $row['userssh'],
'oversell' => $row['oversell'],
'dnscontrol' => $row['dnscontrol'],
'dns' => $row['dns'],
'serverip' => $row['serverip'],
'ip' => 'shared',
'notify' => 'yes'
));
Algo asi, o bien hacer otra cosa como crear la cadena afuera
$array .= "'action' => 'create',";
$array .= "'action' => 'Submit',";
etc ....
y despues dejar array($array);. ¿es posible?
Gracias =)