Skip to content

Tag: php

PDO and MySQL ‘between’

I’m trying to get PDO to work with a MySQL ‘between’. Below is my code: What gets returned is an array with ‘0’ or ‘NULL’ for values. When I hard code the end date, it acts as if start_date is set to -1, retuning me all rows before the end_date. So, what am I doing wr…

PHP Script to Traceroute?

I have a website running PHP on a GoDaddy shared linux server. I need to determine if users are connected to the companies VPN. If I simply do $_SERVER[‘REMOTE_ADDR’] it gives me the clients IP address. However if I can dig deeper with a tracert, the 2nd hop would show up as the companies IP addre…

Switch between PHP versions on OS X Mountain Lion

Is it possible to have multiple versions of PHP installed on OS X Mountain Lion and freely change between them? Similar to the way MAMP allows you to. I’m wanting to get out of using MAMP and this is really the only feature holding me back. Answer Here’s a great blog post about Maintaining two ver…

How can i “merge” these two regular expression in PHP?

I’m learning regular expression, so please go easy with me! Username is considered valid when does not start with _ (underscore) and if contains only word characters (letters, digits and underscore itself): In order to merge them in one regular expression, i’ve tried the following: To be read as: …

php get values from json encode

I have an url passing parameters use json_encode each values like follow: $json = array ( ‘countryId’ => $_GET[‘CountryId’], ‘productId’ => $_GET[‘ProductId’], ‘status’ => $…