Ejemplo n.º 1
0
	<section>
		<header>List All Available Units</header>
		<p>you can generate a list of all compatible units using the getUnits() function.</p>
						<pre>
$getUnitsConvertor = new Convertor();
$getUnitsConvertor->getUnits("m"); //returns converted value</pre>

		<p>This will return an array of all available units compatible with the specified unit:</p>

		<?php 
$getUnitsConvertor = new Convertor();
?>

		<pre><?php 
echo json_encode($getUnitsConvertor->getUnits("m"), JSON_PRETTY_PRINT);
?>
</pre>

	</section>

	<section>
		<header>Change From Value</header>
		<p>You can change the value and unit you are converting from at any point using the from() function.</p>
		<pre>
$fromChangeConvertor = new Convertor(10,"m");
$fromChangeConvertor->to("ft"); //returns converted value in feet
$fromChangeConvertor->from(5.23,"km"); //sets new from value in new unit
$fromChangeConvertor->to("mi"); //returns converted new value in miles</pre>