Related Content
Recreating Spotify Wrapped In PHP
I quite like the end of the year report from Spotify that they call "Wrapped". This is a little application in which they tell you what your favorite artist was and what sort of genres you listened to the most during the year.
Should A Constructor Throw An Exception?
Let's say you had a class that you wanted to use, but there was some sort of error in creating the object. This might be that the wrong parameters were passed, or the third party service (eg. a database) wasn't available at the time of creation.
PHP Question: Variable Reference
Question
What does the following code print out?
function arrayPrint($array)
{
echo implode(' ', $array);
}
$arrayA = [1, 2, 3];
$arrayB = $arrayA;
$arrayB[1] = 0;
arrayPrint($arrayA);
Creating An Authentication System With PHP and MariaDB
Using frameworks to handle the authentication of your PHP application is perfectly fine to do, and normally encouraged. They abstract away all of the complexity of managing users and sessions that need to work in order to allow your application to function.
Creating Sparklines In PHP
A sparkline is a very small line graph that is intended to convey some simple information, usually in terms of a numeric value over time. They tend to lack axes or other labels and are added to information readouts in order to expand on numbers in order to give them more context.
PHP:CSI - Improving Bad PHP Logging Code
I read The Daily WTF every now and then and one story about bad logging code in PHP stood out to me. The post looked at some PHP code that was created to log a string to a file, but would have progressively slowed down the application every time a log was generated.
Comments
Submitted by Lem on Thu, 08/27/2015 - 02:25
Permalinkphp --info
That doesn't have any HTML in it :)Submitted by philipnorton42 on Thu, 08/27/2015 - 11:48
PermalinkI know this is really old... but for us old timers that are just beginning this php journey, how/where do you run a script like this?
Thanks.
GOJ
Submitted by GoodOlJoe on Tue, 01/31/2023 - 04:24
PermalinkHi GoodOlJoe, thanks for commenting.
You can run this script in two ways.
1) On the command line.
Assuming you have PHP installed, create a file called something like phpinfo.php. Then, open up a terminal prompt, change directory to the same directory that the file is located, and run it like this.
You will find that once it's run you'll have another file in the same directory called phpinfo.html.
2) Via a web server
This is slightly more tricky if you're new to PHP, but there are plenty of tutorials out there on installing PHP and a web server (Apache and Nginx are the main two).
Once you have it installed you need to put the script into the web directory in the form of a file called something like phpinfo.php. All you need to do then is visit the file through your web browser. This might have the following address
Both of these do depend on how you set things up though. In the world of docker containers there are numbers ways in which you can stand up a local web server and run both of these actions.
Good luck!
Submitted by philipnorton42 on Tue, 01/31/2023 - 08:05
PermalinkAdd new comment