Welcome Guest, Not a member yet? Register   Sign In
Problems with sorting arrays returned by get_filenames()
#6

[eluser]xwero[/eluser]
I don't understand why you would want to use the filename as key and as value?

The shortest code would be
Code:
// controller
function album()
{
    if(!$this->uri->segment(3))
    {
       redirect('albums');
    }
    else
    {
         $dateiliste = get_filenames(’dateien/fotos/’ . $this->uri->segment(3) . ‘/’);
         natsort($dateiliste);
         $this->load->view('album',array('fotos'=>$dateiliste,'urlfotodir'=>'http://site.com/fotos/'));
    }
}
// view
<ul>
&lt;?php foreach($fotos as $foto){ ?&gt;
<li><img src="&lt;?php echo $urlfotodir.$foto; ?&gt;"></li>
&lt;?php } ?&gt;
</ul>


Messages In This Thread
Problems with sorting arrays returned by get_filenames() - by El Forum - 02-21-2008, 04:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB