Skip to content

Instantly share code, notes, and snippets.

@hanafiah
Created September 18, 2013 00:30
Show Gist options
  • Save hanafiah/6602779 to your computer and use it in GitHub Desktop.
Save hanafiah/6602779 to your computer and use it in GitHub Desktop.
<?php
$destination_url = Array(
0 => 'http://www.google.com',
1 => 'http://www.google.com',
2 => 'http://www.google.com'
);
$split_percentage = Array(
0 => 50,
1 => 50,
2 => 45,
);
// $this->view_data['links_split'] = $this->m_links->get_links_split($links_id, $session['id']);
// if ($this->form_validation->run() == TRUE) {
// .....
// .....
// last , tambah
// $this->view_data['links_split'] = $this->m_links->get_links_split($links_id, $session['id']);
// }else{
$links_split = array();
foreach($destination_url as $key=>$value){
$split=new stdClass();
$split->destination_url=$value;
$split->split_percentage=$split_percentage[$key];
$links_split[] = $split;
}
//tambah nih, supaya akan override
//$this->view_data['links_split'] = $links_split;
//}
print_r($links_split);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment