". $lorem[$i] ."
"; } return $html; } function some_lorem_title() { // make an array of $lorem = explode(".", // sentences only str_replace(". ", ".", implode(" ", LOREM) // made from all Lorem-ipsums ) ); shuffle($lorem); return $lorem[0]; } include 'pythia.php'; $categories = $wiki->get_categories(); $non_root = []; foreach($categories as $node) { if (intval($node['parent_id']) > 0) { $non_root[] = $node['id']; } // if (intval($node['parent_id']) > 5) { $non_root[] = $node['id']; } } // print_r($non_root); die(); echo "";
for( $i = 0 ; $i < 250 ; $i++ ) {
$temp = $non_root;
shuffle($temp);
$post = [
'title' => some_lorem_title(),
'category' => intval($temp[0]),
'body' => some_lorem_html()
];
print_r($post);
$wiki->add_post($post);
}
echo "";