Re: Do RPC calls to transmission-daemon through php
Posted: Sun Jul 04, 2010 1:33 pm
Yep, new version is commited and available as a download. Great work brycec! I was really impressed with the results of your merge.
A Fast, Easy, and Free BitTorrent client
https://forum.transmissionbt.com/
Code: Select all
235 protected function cleanRequestData ( $array )
236 {
237 if ( !is_array( $array ) || count( $array ) == 0 ) return null;
238 foreach ( $array as $index => $value ) {
239 print(json_encode($array));
240 if( is_array( $array[$index] ) ) $array[$index] = $this->cleanRequestData( $array[$index] ); // Recursion
241 if ( empty( $value ) && $value!=0) unset( $array[$index] );
242 }
243 return $array;
244 }
Code: Select all
&& $value!=0
Code: Select all
$anarray = array(5,4,7,2);
unset($anarray[2]);
json_encode($anarray);
Code: Select all
{"0"=>5, "1"=>4, "3"=>2}
Code: Select all
[5,4,2]