Apple Info

array(
“Release Year” => “2021”,
“Display” => “6.7-inch Super Retina XDR OLED”,
“Chipset” => “Apple A15 Bionic”,
“Camera” => “Triple 12MP”,
“Battery” => “4352 mAh”,
“OS at Launch” => “iOS 15”
),
“iPhone 14 Pro” => array(
“Release Year” => “2022”,
“Display” => “6.1-inch Super Retina XDR OLED, 120Hz”,
“Chipset” => “Apple A16 Bionic”,
“Camera” => “48MP + 12MP + 12MP”,
“Battery” => “3200 mAh”,
“OS at Launch” => “iOS 16”
)
);

$output = ‘



‘;

if (isset($_POST[‘iphone_model’])) {
$model = sanitize_text_field($_POST[‘iphone_model’]);
if (array_key_exists($model, $iphone_data)) {
$output .= “

Results for $model:

    “;
    foreach ($iphone_data[$model] as $key => $value) {
    $output .= “

  • $key: $value
  • “;
    }
    $output .= “

“;
} else {
$output .= “

No info found for $model.

“;
}
}

return $output;
}
add_shortcode(‘iphone_info_tool’, ‘iphone_info_tool_form’);

Comments

One response to “Apple Info”

  1. A WordPress Commenter Avatar

    Hi, this is a comment.
    To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
    Commenter avatars come from Gravatar.

Leave a Reply

Your email address will not be published. Required fields are marked *