Skip to content

Instantly share code, notes, and snippets.

@stewartduffy
Created May 14, 2013 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stewartduffy/5574778 to your computer and use it in GitHub Desktop.
Save stewartduffy/5574778 to your computer and use it in GitHub Desktop.
Import php array into PODS table, WordPress
<?php
$data = array(
"Performance Coaching",
"Principal Responsibilities of Leadership",
"Strategic Performance Template",
"Team Performance Compact",
"Team Performance One",
"Management Performance Compact",
"Management Performance One",
"Leadership Performance Compact",
"Leadership Performance One",
"Executive Performance Compact",
"Executive Performance One",
"How to Advance the Performance of a Team",
"Performance Coaching",
"Principal Responsibilities of Leadership",
"Strategic Performance Template",
"Team Performance Compact",
"Team Performance",
"Sales Performance Compact",
"Sales Performance",
"Sales Manager Compact",
"Sales Manager",
"Management Performance Compact",
"Management Performance",
"Leadership Performance Compact",
"Leadership Performance",
"Executive Performance Compact",
"Executive Performance",
"How to Advance the Performance of a Team",
"Performance Coaching",
"Pro-Sport compact",
"Pro Sport",
"Advanced Performer",
"Performance Coaching",
"The Principal Responsibilities of Coaching",
"Pro-Sport Coach compact",
"Pro-Sport Coach",
"How to Advance the Performance of an Athlete"
);
$i = 0;
foreach($data as $d){
$data_new[$i] = array(
"name" => $d,
"ref" => "",
"bpm" => "",
"dpm" => "",
"info_pack" => "",
"tdm" => "",
"description" => ""
);
$i++;
}
echo "<pre>";
print_r($data_new);
echo "</pre>";
$api = new PodAPI('programme_content', 'php');
$api->import($data_new);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment