Skip to content

Tag: php

Get Specific Device Information

Using just PHP, is there anyway to detect if the page is being loaded from a SPECIFIC device? Say, I would want the page to react differently if only MY iPhone was loading the page, no one else’s? The only solution I have so far is to use $_SERVER[‘REMOTE_PORT’ in conjunction with $_SERVER[&…

Spl, ArrayObject, ArrayObject::STD_PROP_LIST

I’m trying to understand STD_PROP_LIST constant in the documentation but so far i didn´t understand it, and didn´t found any explanation 🙁 The documentation has the following example: Both prints give me the same exact result: Anyone could help me understanding what is the difference between using this …

Get previous week number from php week number

I currently need to get the previous week from a variable that passes a php week number so if it is week 13 I will get week 12. The problem I am facing is that if I just minus 1 from the original number if I am in week 1 it will return week 0 unless I create an if

Using isset() inside a foreach doesn’t work?

Basically, I have an indefinite number of buttons that I want to generate from variables held in the mysql database. Now when I try to press the buttons nothing happens. This is the code I thought might work for that: There are no errors. I think it’s because I can’t use isset inside a foreach thi…