Follow: Like PHP-Scripting @ FacebookFollow Php-Scripting.com @ TwitterFollow Php-Scripting.com @ Google PlusSubscribe to PHP Scripting @ YouTubeSubscribe to PHP-Scripting.com RSS Feed

PHP Scripting - Free & Cheap Scripts, Tutorials & More Cool Stuff

Free & Cheap Scripts, Tutorials & More
Home Free Scripts
Contact
Share:

PHP Scandir Function Usage Example

Listed in PHP Tutorials
PHP Scandir Function Usage Example
I have covered the Scandir PHP function briefly in the past, but I thought it might be useful for those who use their own content management systems to see how displaying images with this great function can be carried out.

This article covers just one of many ideas, but it should provide the gist of the utilization of Scandir. We can return either the image file names, and/or, as provided in the second example, a table grid of the images for viewing reference. The possibilities really are almost endless.

Upload Files and Produce HTML Code

Listed in PHP Tutorials
Upload Files and Produce HTML Code
I thought perhaps a short tutorial based around my Quick Image Code Creator free script would be helpful to those looking to create HTML codes on the fly after uploading a file.

As with the free script, my example uses image uploads. However, this small script could be amended to accommodate any file type. Why hand code HTML after uploading a file when you can utilize a PHP script like this?

File System Functions in PHP

Listed in PHP Tool Box
File System Functions in PHP
Last week I covered the basics of reading files with PHP, however, I thought it might be a good idea to elaborate on the topic a bit more. There are many functions that can be used when handling system files, so I only cover a few here in order to keep things simple.

I use these particular system file handling functions on a regular basis when scripting content management systems and websites for clients. Whether it's something as simple as checking to see if a file exists, or backing up particular files, these functional examples should be quite helpful to those who code with PHP.

Reading File Contents With PHP

Listed in PHP Tool Box
Reading File Contents With PHP
Whether one chooses to use the function 'fopen' or perhaps 'file_get_contents', PHP offers several ways to read and manipulate file content in order to return it accordingly. In this article I cover a basic 'fopen' statement, then expand on the return by utilizing 'file_get_contents'.

If you are looking to turn a list of items into URLs, this is the article for you. It's much easier to do than you may think. Follow these examples and you should be on your way to creating URLs on the fly from a simple txt file list.

Variable Handling Functions PHP

Listed in PHP Tool Box
Variable Handling Functions PHP
I've covered variables fairly extensively here at PHP-Scripting. However, what I haven't touched on yet are functions that allow for the manipulation of variables within PHP. Finding out what types of variables they are and handling them accordingly can make for a much better script.

I cover 4 basic examples here with variable functions that I personally use fairly often. There are several to choose from within the PHP language though, so be sure to do your research beyond my site. I provide a link at the end of this article which will help you expand your research.

Regular Expressions Introduction

Listed in PHP Tutorials
Regular Expressions Introduction
There are a few names for them, PHP regular expression functions. Regex is quite common, however, the official PHP site refers to them as PCRE functions. Which is probably the proper terminology to use, as they are the official site for the PHP language.

There are quite a few things you can do with Regex functions, as well as numerous ways of configuring expression syntax. A visit around the net will help you get more familiar with how to configure them properly. For this article though, I keep things pretty simple while presenting a few basic examples.

PHP Character Function

Listed in PHP Tool Box
PHP Character Function
Dealing with characters is one of PHP best suits, among many others. Thus, the 'character' function can come in very handy when handling and returning information about particular characters. Be they alphanumeric, numeric, printable or otherwise, this is a pretty helpful function to learn about and utilize whenever necessary.

I offer 7 examples in this article, explaining what each specific function does and how it might be used within a script. I use these 7 examples quite often, whenever certain scenarios call for them.

PHP Calendar Function

Listed in PHP Tool Box
PHP Calendar Function
I personally don't use the PHP calendar function very often, as I find date and time provide pretty much everything one needs to return this type of information. However, that doesn't mean that the calendar function shouldn't be looked in to.

This is s short article on the PHP calendar function, showing a few examples of how it can be used in a basic context.

Logical Operators In PHP

Listed in PHP Tutorials
Logical Operators In PHP
It isn't to say that I haven't used logical operators to a large extent already within my article examples and scripts on this site, but understanding how they work and what our options are as PHP developers is yet another matter.

This article covers basic logical operators and how they can be used in every day examples. If you use HTML forms to process user information then you probably configure logical operators to validate the information and aren't even aware of it.

Assorted PHP Functions

Listed in PHP Tool Box
Assorted PHP Functions
I've mentioned several times in articles here at PHP-Scripting how many built-in functions there are within the PHP development language. Many we may never use, while there are others which get used each and every day by 1000's of web developers.

These 4 functions can be put to good use, given the right circumstances. 3 out of the 4 can be used for security purposes, while one could assist with website layout. I love the power of PHP built-in functions.

PHP Date and Time Functions

Listed in PHP Tool Box
PHP Date and Time Functions
I've made reference to the PHP date function quite a bit here at PHP-Scripting.com and given that it is such a relevant part of web development, an article introducing it and the time function was completely inevitable. Date and time can produce some very interesting results and can even define certain conditions if configured properly.

I provide a few examples of using the date and time PHP functions in this article, creating scenarios that I have personally used quite often in the past while developing.

PHP Session Unset

Listed in PHP Tool Box
PHP Session Unset
It would appear as though I forgot to include 'unset' in my introduction to PHP sessions article a while back. I don't know how that could have happened. Oh wait, I'm human...I think. ;-) Well, this function has to be covered eventually, so here we have it.

Session unset is very handy and while this example is quite basic, a person could really expand on it and do some cool things. Session unset is especially helpful when you only want to destroy certain set sessions at particular times.

Embedding Media On Web Pages

Listed in PHP Tutorials
Embedding Media On Web Pages
There will almost always come a time where we need to embed media on web pages. While the concept is mostly an HTML related one, I provide some examples here where I create HTML form fields for entering in the names of the media items, which are then processed with PHP.

MP3 audio, MP4 and YouTube videos are covered in this post. This is a bare bones way of embedding, with no protection from downloading being put in place. That is something I can go into at a later date. However, for basic web page media embedding, these ideas will work fine.

Processing Form Textarea Lists

Listed in PHP Tutorials
Processing Form Textarea Lists
Bulks lists typed or pasted into HTML form textarea fields are fairly common, so PHP coders should know how to process them for either a simple return, or to insert into database tables. The processing is actually quite basic, but does depend on what one is shooting for.

This article discusses a simple return of a list of data typed into a textarea field, then features an example of how you might break up the array and insert it into a MySQL database table.

Sorting Arrays PHP

Listed in PHP Tool Box
Sorting Arrays PHP
PHP and arrays go together like bread and butter - they can't survive without one another, really. Arrays are considered the best way of storing multiple forms of data. I've discussed several different ways of returning arrays, but one of the easiest to use is the sort function.

This is a short post on the 'asort' and 'ksort' options for sorting out array keys and values. I cover an example of using each and then include a while statement that could be related to a variable passed from an HTML form or a search engine on a website.
Free Scripts Added
May 13, 2016

Quick Link Builder

Quick Link Builder Read about it »
April 4, 2016

Quick Image Code Creator

Quick Image Code Creator Read about it »
March 26, 2016

PHPJQ Image Gallery Creator

PHPJQ Image Gallery Creator Read about it »
More Site Additions
May 28, 2016
The browser version of Quick Link Builder is now available for everyone to use - free, of course. It can be found here. I hope it can be of good use to you.
May 28, 2016
PHP-Scripting.com is growing quickly as I continue to publish coding related and general articles, so I figured it was time to script up a search engine. It's bare bones, but should supply you all with a way of finding particular articles on the website. I hope it works well for you.
April 2, 2016
I finally found the time to script up a Contact form. It can be reached here or from the main menu. If you find anything wrong on the site, would like to send some feedback or want to contact me about some PHP and/or website design work don't hesitate to use the form to get a hold of me. I will respond within a 48 hour period.
March 30, 2016
I wrote up a comment script and implemented it into the site here for each article page. I may add it to other pages, but for the time being it will work just fine for people to leave comments on the articles, if they wish. Try it out and leave a comment in the box located at the bottom of an article page. :-)
Recent Article Comments
"Thanks for showing us newbies the basics. I am learning quite a bit from your beginner's tutorials. I am going to give your code a try and see what I can do with it. Much appreciated...newb"
Read article »
"This will definitely come in handy for a project I have coming up soon. Thanks for making it available. :-)"
Read article »
Recommended Reading

CSS3 - Missing Manual

CSS3 - Missing Manual
Whenever I have some free time I try working on gaining a more modern understanding of CSS and in particular, CSS3. I purchased this book for Kindle about 3 months ago and so far it's helped me learn a lot.

Fair warning though for those who are used to older versions of CSS. There are a lot of new concepts being used in CSS3, some of which are a bit hard to wrap your head around at first. I hear that CSS3 support is growing quite rapidly and with the power of it the possibilities in regard to web design are almost endless. A very helpful book to have around, indeed.
Get it here »

Mastering Responsive Web Design

Mastering Responsive Web Design
I never thought I would actually buy a book on responsive web design but about 3 years ago I was getting rather frustrated with trying to get websites to look half decent on small screens. Mastering Responsive Web Design helped me immensely in learning what to do and most notably, what not to do when it comes to responsive design.

This is a later edition, released in 2015 and is even better than my older version. Things have gotten a bit easier with responsive web design over the past 3 years but I still have to be thankful for this book.
Get it here »

PHP & MySQL for Dummies

PHP & MySQL for Dummies
This is one of the books I keep around as a desk reference for PHP and MySQL coding. It was a great book to learn from too, I can tell you that. While not all the 'For Dummies' books are good, this is one of the better ones. I don't say that lightly, either.
Get it here »

Jquery Pocket Reference

Jquery Pocket Reference
You know you're a total code head when you carry around a Jquery pocket reference book. ;-) That would be me. I'm still not very good at Jquery, in my opinion, but I continue to try to learn it and this book has been pretty helpful with that.

The paperback is small and pretty tough. I should know because I've put it through a beating. I recommend it to those who want to have a good Jquery coding reference kicking around. It's available for Kindle too.
Get it here »
Fun Coding T-Shirts