Hi all, i’m a newbie in Php
I have to add a pagination to this page that goes to read a csv file with too many lines…For example to change every 100 records
Thank u in advance
This is the code:
<?php
$csv = array_map('str_getcsv', file('data/galleries2.csv')); //print_r($csv);
if ($csv):
/*
[0] => <!-- Website
[1] => <!-- Date
[2] => <!-- Title
[3] => <!-- Url
[4] => <!-- Urlimage
*/
?>
<div class="content-loop grid clearfix">
<?php for ($x = 1; $x < count($csv)-1; $x++): ?>
<div class="grid-item">
<article class="hentry">
<div class="entry-image clearfix">
<a target="_blank" href="<?php echo $csv[$x][3]; ?>"><img src="<?php echo $csv[$x][4]; ?>" alt=""/></a>
</div>
<header class="entry-header">
<h2 class="entry-title"><a target="_blank" href="<?php echo $csv[$x][3]; ?>"><?php echo $csv[$x][2]; ?></a></h2>
</header>
<div class="entry-footer clearfix">
<div class="entry-meta">
<span class="entry-category"> <h6><?php echo $csv[$x][0]; ?></h6></a></span>
</div>
</div>
</article>
</div>
<?php endfor; ?>
</div>
<?php endif; ?>