$currentPage; $hasPrevPage = $currentPage > 1; $nextPageUri = $hasNextPage ? preg_replace( '/sitemap([0-9]*)\.xml/', 'sitemap' . ( $currentPage + 1 ) . '.xml', $data['sitemapUrl'] ) : '#'; $prevPageUri = $hasPrevPage ? preg_replace( '/sitemap([0-9]*)\.xml/', 'sitemap' . ( $currentPage - 1 ) . '.xml', $data['sitemapUrl'] ) : '#'; ?>