Skip to content

Tag: php

Does PHP allow *.properties file as in Java?

Is there a way to use a *.properties file in PHP as you do in Java? I’d like to store some application-level constants in a properties or XML file and easily call them from throughout my code. Your …

GET URL parameter in PHP

I’m trying to pass a URL as a url parameter in php but when I try to get this parameter I get nothing I’m using the following url form: I’m trying to get it through: But nothing returned. What is the problem? Answer $_GET is not a function or language construct—it’s just a variable (an…

Function to add dashes to US phone number in PHP

What is the best way to add dashes to a phone number in PHP? I have a number in the format xxxxxxxxxx and I want it to be in the format xxx-xxx-xxxx. This only applies to 10 digit US phone numbers. Answer EDIT: To be a bit more generic and normalize a US phone number given in any of a

PHP get number of week for month

So I have a script that returns the number of weeks in a particular month and year. How can I take a specific day from that month and determine if it is part of week 1,2,3,4 or 5 of that month? Answer The most frustrating thing I have ever tried to get working – but here it is!

What is the correct URL for MAGENTO admin

I don’t know why my magento is not working any more when I hit “http://localhost.host/amuni/admin” it says Oops! This link appears to be broken. but frontend working fine please tell me what should I do. What is the correct URL? Answer Try like this: http://localhost.host/amuni/index.php/adm…

PHP UTC to Local Time

Server Environment Redhat Enterprise Linux PHP 5.3.5 Problem Let’s say I have a UTC date and time such as 2011-04-27 02:45 and I want to convert it to my local time, which is America/New_York. Three questions: 1.) My code below might solve the problem, would you agree? 2.) But, does the value of $offset…