How can data be sent from PHP to Flash when creating Flash content with PHP?

To send data from PHP to Flash when creating Flash content with PHP, you can use the `echo` function in PHP to output data in a format that Flash can read, such as XML or JSON. Flash can then use a loader object to load this data dynamically.

<?php
$data = array('name' => 'John', 'age' => 30);
header('Content-Type: application/xml');
echo '<data>';
foreach($data as $key => $value) {
    echo '<' . $key . '>' . $value . '</' . $key . '>';
}
echo '</data>';
?>