0

I want to convert

$json_options = array(
    1, // JSON_HEX_TAG
    2, // JSON_HEX_AMP
    4, // JSON_HEX_APOS
    8, // JSON_HEX_QUOT
);

to

1 | 2 | 4 | 8

to be used in

json_encode($data, $json_options);

Of course I don't want to implode them to make an string. How to do that?

3
  • 1
    Of course I don't want to implode them to make an string - can you explain why not, it seems like the obvious choice. Commented Oct 13, 2021 at 7:25
  • 1
    @NigelRen Because the json_encode doesn't accept $json_options as string. Commented Oct 13, 2021 at 7:27
  • 1
    @Ivar Yeah thank you :) Commented Oct 13, 2021 at 7:36

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.