Title: Get table as json or PHP structure
Last modified: October 20, 2023

---

# Get table as json or PHP structure

 *  Resolved [christer_f](https://wordpress.org/support/users/christer_f/)
 * (@christer_f)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/get-table-as-json-or-php-structure/)
 * Using the documented function tablepress_get_table() it is possible to programmatically
   get a table as an HTML string with. For various reasons I need to get tables 
   to process them in PHP and wonder if there is a “stable” function for this. Currently
   I use the following function:
 *     ```wp-block-code
       $table = TablePress::$model_table->load( $id, true, true );
       ```
   
 * This returns the table as a PHP structure. But this function is not documented
   and the question is how stable this is with respect to future updates to TablePress.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/get-table-as-json-or-php-structure/#post-17146288)
 * Hi!
 * Thanks for your post and sorry for the trouble!
 * Yes, you are fine here. Using `TablePress::$model_table->load()` is the recommended
   way for this. I don’t have plans to remove/rename that function (and if I were,
   I would add a backward-compatibility layer).
 * Best wishes,
   Tobias

Viewing 1 replies (of 1 total)

The topic ‘Get table as json or PHP structure’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/get-table-as-json-or-php-structure/#post-17146288)
 * Status: resolved