Skip to content

Tag: php

Use PHP foreach loop to display data in many html div tags

I have the following data and would like to display it in different containers in html. The containers are winner_1. As of right now the first winner_1 display the last Name from the above table. How can I get it to say CA.PA in the first winner_1, and AZN.ST in the second winner_1, and AMGN in the last winne…

utf8_encode difference between result in SQL and PHP

I’m using utf8_encode to make sure that the input from my users is transforming the special characters to a character where my MYSQL can do a search on. (My database is set in latin1_swedish.ci). When I echo my query, I get a perfect query that I can run against my MYSQL (and I get an result). But when …

Composer install fail on TFS Server

We are running a Team Foundation Server (on premises) and as part of a build process it runs composer to install dependancies. Sometime in the last week this process has started failing and I cannot figure out why. Here is the console output from a failed run: Here is part of the output from a successful run …

List all json files from folder then sort by date and paginate it

I need help to make it work. I’m using this code for list all json files from folder and paginate it and this works well. But how can I implement sort by getMTime() and krsort()? I want the last modified files at first. Answer Store the mtime values in a separate array, then sort by them with usort. Bef…

Running PHP commands gives Xdebug errors

I’m currently getting some weird error messages whenever I run which php or php –ini: I currently have 4 php versions in my /usr/local/etc/php folders: currently using php7.3 as my default php version. I’m planning to remove older php versions if that doesn’t cause much trouble. Can so…

SESSION in laravel for page protection

I want to make a Login Registration system in laravel 8. In which User when login only can access a particular page else redirect to login page. I did this like that. what’s wrong in it. //Login Code //Session Code Answer you can use the default authentication in laravel8 using laravel application Jetst…