PHP code example of infomaniac-amf / php

1. Go to this page and download the library: Download infomaniac-amf/php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

infomaniac-amf / php example snippets





a = array(
	'any' => 'data',
	'you' => 'like'
);

header('Content-Type: application/x-amf');
echo amf_encode($data);

$data = array(
	'any' => 'data',
	'you' => 'like'
);

$encodedData = amf_encode($data);
$data = amf_decode($encodedData);



class Person {
	public $name;
}

amf_encode($data, AMF_CLASS_MAPPING);

object(Person)[8]
  public 'name' => string 'bob' (length=3)
json
{
	"maniac-amf/php": "dev-master"
	}
}