R
R
Rishat Sultanov2017-03-18 13:05:27
Laravel
Rishat Sultanov, 2017-03-18 13:05:27

How to check the number of files in a directory?

Good afternoon, ladies and gentlemen.
I have a slider and relative links to each image.
Therefore, I implemented the replenishment of slides from the admin panel.
But how to foreach through the directory and pull out all the jpg images and add them to the slider with a relative link?

<li><img src="/storage/app/public/slider/images/1.jpg" alt="" title="" id="wows1_0"/></li>
<li><img src="/storage/app/public/slider/images/n.jpg" alt="" title="" id="wowsn_n"/></li>

Slider code:
<!-- Start WOWSlider.com BODY section -->
<div id="wowslider-container1">
<div class="ws_images"><ul>
        <li><img src="/storage/app/public/slider/images/1.jpg" alt="" title="" id="wows1_0"/></li>
        <li><a href="http://iuca.kg"><img src="/storage/app/public/slider/images/1.jpg" alt="wowslideshow" title="" id="wows1_1"/></a></li>
        <li><img src="/storage/app/public/slider/images/1.jpg" alt="" title="" id="wows1_2"/></li>
    </ul></div>
    <div class="ws_bullets"><div>
        <a href="#" title=""><span><img src="/storage/app/public/slider/tooltips/1.jpg" alt=""/>1</span></a>
        <a href="#" title=""><span><img src="/storage/app/public/slider/tooltips/2.jpg" alt=""/>2</span></a>
        <a href="#" title=""><span><img src="/storage/app/public/slider/tooltips/3.jpg" alt=""/>3</span></a>
    </div></div><div class="ws_script" style="position:absolute;left:-99%"><a href="http://iuca.kg"></a> by R.S</div>
<div class="ws_shadow"></div>
</div>  
<script type="text/javascript" src="engine1/wowslider.js"></script>
<script type="text/javascript" src="engine1/script.js"></script>
<!-- End WOWSlider.com BODY section -->

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2017-03-18
@gangstarcj

php.net/manual/ru/function.scandir.php
THE FIRST LINK IN GOOGLE

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question