Use this code to create a PHP slideshow with Advanced Custom Fields (a WordPress plugin) and Bootstrap 4.0.

Boostrap 4 —
https://getbootstrap.com/docs/4.0/components/carousel/

Advanced Custom Fields Gallery — https://www.advancedcustomfields.com/resources/gallery/

  <?php 
$images = get_field('gallery');
$count=0;
$count1=0;

if($images) : ?>
            <section class="mb-3" id="afcbsGallery">
                <div id="slider">
                    <div id="carousel" class="carousel slide">
                        <!-- Indicators -->
                        <ol class="carousel-indicators">
                            <?php foreach( $images as $image ): ?>
                            <li data-target="#carousel" data-slide-to="<?php echo $count; ?>" <?php if($count==0) : ?>class="active" <?php endif; ?>></li>
                            <?php 
		$count++;
        endforeach; ?>
                        </ol>

                        <!-- Wrapper for slides -->
                        <div class="carousel-inner">
                            <?php foreach( $images as $image ): ?>
                            <div class="carousel-item<?php if($count1==0) : echo ' active'; endif; ?>">
                                <a href="<?php echo $image['sizes']['large']; ?>"><img class="d-block w-100" src="<?php echo $image['sizes']['large']; ?>" alt="<?php echo $image['alt']; ?>" /></a>
                            </div><!-- item -->
                            <?php 
        $count1++;        
        endforeach; 		
        ?>