When given an array, this will remove any keys with the name //
.
Parameters
$input_array
arrayrequired- The array to filter.
Source
private static function remove_json_comments( $input_array ) {
unset( $input_array['//'] );
foreach ( $input_array as $k => $v ) {
if ( is_array( $v ) ) {
$input_array[ $k ] = static::remove_json_comments( $v );
}
}
return $input_array;
}
Changelog
Version | Description |
---|---|
6.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.