Skip to content

Tag: php

PHP strtolower ignoring the first character

I am looking for a way in which each word from the 2nd letter to write everything small. The first letter should be ignored. Does anyone have an idea? Answer You have to write your own function to do this. Use something like the following:

php sort filenames with an underscore

I have an array of filenames that I aquire using DirectoryIterator. I am trying to get the filenames to sort so they would be in order like so, this is the way they appear on the server. 2DAYSALEGATE_PG1.jpg 2DAYSALEGATE_PG2.jpg 722_PG1.jpg PW_PG2_COKE_A.jpg PW_PG3_COKE_A.jpg PWBY4_DELI-1.jpg When aquiring th…

Remember selected value for next visits

I have a dropdown like this. How can I show the selected value automatically at second time? First time it allows user to select an item from the drop down menu. But at second time it should show the previous selected value. How can I do this? Answer Your question is quite broad, so I will give you a short

How to check that day is last day of month in php?

My previous question: how-to-find-current-day-no-in-month-in-php Now I face another problem. Suppose I know that this monday is the 4th monday of the current month. Now how to check that this monday is also the last monday of the current month? Using the code below, I get the name and number of a day: This is…

How to find current day no. in month in php

Today’s date is 27-01-2014 so I got day name using following function: So now the day name is mon. How to find that this Monday is the forth Monday of current month? In other words, I am trying to find the 1st, 2nd, 3rd, 4th of a particular day (eg. Monday) of a month? Answer Credit for the Math part