I want to compare $images, $uploads but the outputs have different names:

```
$images = '/fiscalapplications/uploads/Image_00314_20200122.pdf';  
$uploads = 'Image_00314_20200122.pdf';

```

How do I do SUBSTR for the $images to = Image\_00314\_20200122.pdf 

```
<?php
//pulling images from mysql colum1
require_once 'database_connection.php';
$result = mysqli_query($conn,"SELECT check_pic_path FROM checklog");

$images = []; // store a list of images from the database

while ($row = mysqli_fetch_array($result)) {
    $images[] = $row['check_pic_path'] . "<br>";
}

//pulling pictures from specific path
$dir = "fiscalapplications/uploads";

$uploads = []; // store a list of files on disk

if(is_dir($dir)) {
    while (($file = readdir($dh)) !== false) {
        $uploads[] = $file . "<br>";
    }
}
}

//attempting to compare $image to $upload
$compare = array_diff($images, $uploads);
print_r($compare);

```