Last active
November 30, 2023 22:04
-
-
Save IgorDePaula/0c894ad5db9022f4aea4ac29a182a316 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
$data = [ | |
[ | |
'id'=>2, | |
'name'=>'asd' | |
] | |
]; | |
$strutrura = new stdClass; | |
$strutura->origin_id = 2; | |
$newArray = []; | |
forech($data as $line){ | |
$newArray[$line['id']] = $line; | |
} | |
$strutura->nome = $newArray[$strutura->origin_id]['nome']; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment