Detect MIME type and buffer it to browser using PHP

The following piece of code handles detection of mime type, file size and existence of the file for you. I always use this piece for buffering files into browser of my users.

All you have to do is to change the variable of $filelocation with your own variable which contains the full address of your local file.

Hope it helps some of you out there.

Keep Get Variables with Laravel 5 Pagination in Blade

Using pagination in Laravel views using blade will automatically add the pages get request to the page whenever you click on a page number. by default this will cause all other get requests of the page to be removed and replaced by ?pages.

To overcome this you should use the pagination in your blade template like below:

Of course you need to change $yourlist to your variable name which contains the array you wish to paginate.

Incoming search terms:

  • https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1824 ywfGZo4Nd_ap5U9y7J-utsaF_j4bm_uirXLWYKsZlTtZhkySeJFpHKlNbMH9-esi 29e2a83f6d251c8aec6d8708b2156a29078f60d9&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme
  • https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1833 4mthMg8ZMzk9XMUDRW1fgNquVL06JOS-QCR4vzVEqqfTQJ0jwe3KLiizkZ0OCZ_d fb9fea01e78cbbcea537acaf2c34c8361f4721bf&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme
  • https://yandex ru/clck/jsredir?from=yandex ru;search;web;;&text=&etext=1841 bzug81dZCBRgcTGNXfBpHUZ2MKTUqimZcH1im1ll-YXiIA-qe_U8SJhwuSUS5FyT 3a7233f8614e228f238ec87a38ad2e2caee40c7a&uuid=&state=_BLhILn4SxNIvvL0W45KSic66uCIg23qh8iRG98qeIXme