Solution:$unprefixed_keys = preg_filter('/^foo-(.*)/', '$1', array_keys( $arr ));
Example:
<?php
$arr_main_array = array('foo-test' => 123, 'other-test' => 456, 'foo-result' => 789);
$unprefixed_keys = preg_filter('/^foo-(.*)/', '$1', array_keys( $arr_main_array
));
print_r($unprefixed_keys);
?>
Example:
<?php
$arr_main_array = array('foo-test' => 123, 'other-test' => 456, 'foo-result' => 789);
$unprefixed_keys = preg_filter('/^foo-(.*)/', '$1', array_keys( $arr_main_array
));
print_r($unprefixed_keys);
?>
0 comments:
Post a Comment