PHP API: Generate Random Gemini Data

By: fyvo July 27, 2025 PHP

Description

This PHP code generates a JSON response containing random Gemini data. It's a simple example and can be expanded for a more complex API.

Code Snippet

<?php

header('Content-Type: application/json');

$geminiData = array(
    'name' => 'Gemini',
    'sign' => '♊',
    'element' => 'Air',
    'modality' => 'Mutable',
    'rulingPlanet' => 'Mercury & Venus',
    'luckyNumber' => rand(1, 99),
    'luckyColor' => ['Yellow', 'Orange'][rand(0,1)]
);

echo json_encode($geminiData);

?>

Discussion (0)