Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7858087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:16:00+00:00 2026-06-02T21:16:00+00:00

I have PHP generating JSON data but I am having a problem making a

  • 0

I have PHP generating JSON data but I am having a problem making a example.json file from it. What am I doing wrong? I just get a blank screen.

<?php 
require('wp-load.php');

$EM_Events = EM_Events::get( array(
'scope'=>'future', 
'orderby'=>'event_start_date,event_start_time', 
'limit'=>1, 
'owner'=>false, 
'category'=>'6,7,8,10,11,12,13,14')
);

foreach ($EM_Events as $event) {
        //Event Detail
        $event_id = esc_html($event->event_id);
        $event_name = esc_html($event->name);


$events[] = array(
'event_id'=> $event_id,
'event_name'=> $event_name,
);

} 

$response['events'] = $events;

$fp = fopen('example.json', 'w');
fwrite($fp, json_encode($response));
fclose($fp);

?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T21:16:01+00:00Added an answer on June 2, 2026 at 9:16 pm

    Try using a response sniffing tool like Fiddler http://www.fiddler2.com/ or use the network tab of the browser’s developer tools like Firebug http://getfirebug.com/ Maybe the content came down just fine, it’s just that your browser doesn’t know how to render it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am generating a rss(xml) output form a php file. I have got a
I have PHP code which connects to MySql and encodes data to JSON. Later
I have a large nested array that I'm generating from parsing a CSV file
I'm generating JSON response from PHP witch looks like this: { done:'1', options: [{
I have a php file generating XHTML content and I use <?php header('Content-type: application/xhtml+xml');?>
Possible Duplicate: Generating a JavaScript array from a PHP array I just want to
A PHP script is generating the following table panel based on the data from
I have php generating html and I want to create layers. Basically I want
I have a PHP script which is generating buttons to each content schedule. The
I have been using php from some time and I have noticed that it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.