Title: Transfer block information to array
Last modified: August 21, 2016

---

# Transfer block information to array

 *  Resolved [gavinjsr](https://wordpress.org/support/users/gavinjsr/)
 * (@gavinjsr)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/transfer-block-information-to-array/)
 * Hi I am wondering there is a way to transfer the information from a block into
   an array.
 * Thanks,
 * Gavin
 * [http://wordpress.org/plugins/multiple-content-blocks/](http://wordpress.org/plugins/multiple-content-blocks/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Harold Angenent](https://wordpress.org/support/users/harold-angenent/)
 * (@harold-angenent)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/transfer-block-information-to-array/#post-4418908)
 * Sure, you can put almost anything in an array. But I don’t fully understand what
   you mean.
 * You want to put the content of a block in an array? Like this?
 *     ```
       $my_array = array( get_the_block( 'My block' ) );
       ```
   
 *  Thread Starter [gavinjsr](https://wordpress.org/support/users/gavinjsr/)
 * (@gavinjsr)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/transfer-block-information-to-array/#post-4418914)
 * Hi Harold.
 * I have installed the multiple blocks plugin to allow the user to manage the postcodes
   allowed.
 * ie:
 * BT1AAA,BT1BBB,BT1CCC,BT1DDD
 * So I then want to explode this into an array as such:
 * $var = array(“BT1AAA”,”BT1BBB”,”BT1CCC”,”BT1DDD”);
 * Thanks,
 * Gavin
 *  Plugin Author [Harold Angenent](https://wordpress.org/support/users/harold-angenent/)
 * (@harold-angenent)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/transfer-block-information-to-array/#post-4418919)
 * Okay.. this is kind of a PHP question and unrelated to our plugin, but I can 
   give you some pointers:
 *     ```
       $postal_codes = get_the_block(  'Postal codes' ); //Or whatever the name is
       $postal_codes = explode( ',', $postal_code ); //Comma separated
       ```
   
 *  Thread Starter [gavinjsr](https://wordpress.org/support/users/gavinjsr/)
 * (@gavinjsr)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/transfer-block-information-to-array/#post-4418921)
 * You’re a Gentleman. I’ll give that a go.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Transfer block information to array’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/multiple-content-blocks.svg)
 * [Multiple content blocks](https://wordpress.org/plugins/multiple-content-blocks/)
 * [Support Threads](https://wordpress.org/support/plugin/multiple-content-blocks/)
 * [Active Topics](https://wordpress.org/support/plugin/multiple-content-blocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/multiple-content-blocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/multiple-content-blocks/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [gavinjsr](https://wordpress.org/support/users/gavinjsr/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/transfer-block-information-to-array/#post-4418921)
 * Status: resolved