<?php if( isset( $_POST['xml'] ) ) { header( "Content-Type: text/xml; charset=UTF-8" ); echo '<?xml version="1.0" encoding="UTF-8" ?>'; $text = ''; // とりあえず 4096 byte 以上を作成する for( $i = 1; $i <= 5000; $i++ ) { $text .= ($i % 10); if( ( $i % 500 ) == 0 ) $text .= '<br>'; } echo '<action><data>'.htmlspecialchars( $text ).'</data></action>'; } else if( isset( $_POST['json'] ) ) { header( "Content-Type: text/html; charset=UTF-8" ); // とりあえず 4096 byte 以上を作成する for( $i = 1; $i <= 5000; $i++ ) { $text .= ($i % 10); if( ( $i % 500 ) == 0 ) $text .= '<br>'; } echo "[ { 'data':'".$text."'} ]"; } ?>