Welcome Guest, Not a member yet? Register   Sign In
About array
#1

[eluser]Unknown[/eluser]
Please anybody can help. I am trying to build a gallery and when I try to get images of directory I get images thumbnail but there is one blank thumbnail. So how do I remove this thumbnail . Please can any body help me.

Code:
function get_images($sata) {
        $this->load->helper('directory');
        $files = directory_map($sata);
        $files = array_diff($files, array('.', '..', 'thumbs'));
        
        $images = array();
        
        foreach ($files as $file) {
            $images []= array (
                'url' => base_url().'uploads/' . $file,
                'thumb_url' => base_url(). 'thumbs/' .  $file
            );
        }

vI have uploaded the screenshot. please Help me
#2

[eluser]InsiteFX[/eluser]
Code:
function get_images($sata)
{
    $this->load->helper('directory');
    $files = directory_map($sata);
    $files = array_diff($files, array('.', '..', 'thumbs'));

    // Debug your code!
    echo var_dump($files);

    $images = array();
        
    foreach ($files as $file)
    {
        $images []= array (
           'url' => base_url().'uploads/' . $file,
           'thumb_url' => base_url(). 'thumbs/' .  $file
        );
}

InsiteFX
#3

[eluser]Unknown[/eluser]
Is it possible to paginate in this function or not. Can any body help me for pagination??I am new to php and codeigniter so I need some help??
#4

[eluser]marjune[/eluser]
before storing the data into $images [] array check it first.




Theme © iAndrew 2016 - Forum software by © MyBB