Created
October 17, 2014 12:55
-
-
Save juareznjunior/6a240421a0327d52c978 to your computer and use it in GitHub Desktop.
PHP array_map, usando private method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Foo | |
{ | |
public function __construct() | |
{ | |
array_map(array($this,'_bar'),explode('#','819f6a8886908b80b8b6e9f212dbeea092dd39#8c3f4db3a634aa769c0f1161219272d032ea40#8b060700f0a542a147685180b143ad61e2bd38')); | |
} | |
private function _bar($ajuste_id) | |
{ | |
echo (float) join('',array( | |
$ajuste_id[0] | |
,substr($ajuste_id, 33, 1) | |
,substr($ajuste_id, 36) | |
)); | |
echo PHP_EOL; | |
} | |
} | |
new Foo(); | |
echo PHP_EOL; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment