jargon

Roe Web Builder Pre-Existing array merge code

Oct 13th, 2021
1,309
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function gen_collectorcard( $about = array() )
  2. {
  3.     $return = '';
  4.    
  5.     $default = default_stats();
  6.  
  7.     foreach( $default as $major => $intermediate )
  8.     {
  9.         if( !isset( $about[ $major ] ) )
  10.         {
  11.             $about[ $major ] = $default[ $major ];
  12.         }
  13.  
  14.         $return .='<td style="vertical-align:top;text-align:center;"><table>';
  15.         $return .= '<tr><td colspan="3" style="vertical-align:middle;text-align:center;">'. longhand_stat( $major ). '</td></tr>';
  16.         foreach( $intermediate as $minor => $value )
  17.         {
  18.             if( !isset( $about[ $major ][ $minor ] ) )
  19.             {
  20.                 $about[ $major ][ $minor ] = floatval( $value );
  21.             }
  22.  
  23.            
  24.             $return .= '<tr><td colspan="1" style="vertical-align:middle;text-align:center;">'.  longhand_stat( $minor ). '</td><td style="vertical-align:middle;text-align:right;">'. floatval( $about[ $major ][ $minor ] ). '</td></tr>';
  25.         }
  26.         $return .='</table></td>';
  27.     }
  28.     $return = '<table style="vetical-align:top;text-align:left;"><tr>'.$return.'</tr></table>';
  29.     return $return;
  30. }
RAW Paste Data