Getting them from PHP into ACF admin will depend on what version of ACF you are using.
The first step is to get the field group into a format that can be imported.
Just after you’ve created the field group in PHP you need to add some code (temporary) that will format the field group for importing and save it as a file. For ACF5 you just need to use
I don’t know how to tell you to format the group for ACF4. I think it uses a standard WP type of import XML file.
As far as keeping the values, as long as your field names and field keys are the same as those generated by PHP then none of your values will be lost.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.