php

Split string from a date.

I want split a string using PHP to get a individual date info. For example: $date = '08/05/2010'; would create the varables $month = '08'; $day = '05'; $year = '2010'; Thank you. ...

What's the difference between PHP 5.3.x and PHP 5.2.x and which one should I use?

Possible Duplicate: PHP 5.3 changelog? I am new to PHP and I am confused which PHP version should I use - 5.3.3 (latest in 5.3.x) or 5.2.14 (latest in 5.2.x). What's the difference between them? Thanks, Boda Cydo. ...

Magento development - too dificult for a junior developer?

Hello there, I am a project manager for a small design agency and we are looking to bring on a new junior developer inline with a new project that he/she will be working on - a magento ecommerce site. How difficult really is magento development? I have heard a lot about its steep learning curve, even for experienced developers but how t...

Using PHP to retrieve Google Spreadsheet as HTML

I'm thinking that someone might of already solved this problem. I tried to look at the Spreadsheets API and there's no mention of being able to download the file. cURL might be an option but I'd rather not get into the hassle of authenticating / POSTing manually. ...

How does one document class attributes using Doxygen?

Hi there! I'm attempting to document class attributes using Doxygen. Currently, the protected attributes show up in the list at the top of the page for the specific class. I'd like to put an explanation for them. I've tried using @param [name] [description] both above the beginning of the class and right above the declaration of the at...

my GET variable is being escaped?

I'm really confused here, can someone explain this to me? request: http://example.com/test.php?var=String's $a = $_GET["var"]; $b = "String's"; echo $a . "<br/>"; echo $b . "<br/>"; $output = mysql_real_escape_string($a); $output = mysql_real_escape_string($b); echo "<hr/>"; echo $a . "<br/>"; echo $b . "<br/>"; result: String\'...

Emailing A Dynamically Created PDF Through PHP

I've recently created an online template for creating job postings for our website. Everything is all done, it formats correctly in a browser, automatically posts to our website, bla bla bla. The last piece I'm creating is to give the administrator a few options for distributing the posting to various places (via email) in a consistent,...

Which is better: Dependency Injection+Registry or Dependency Injection or Global Registry?

Firstly, I want to restrict this question to web development only. So this is language agnostic as long as the language is being used for web development. Personally, I am coming at this from a background in PHP. Often we need to use an object from multiple scopes. For example, we might need to use a database class in the normal scope b...

Php get current active class for menu

May i know how set active menu which page something like page.php?name=about $a = basename($_SERVER['SCRIPT_NAME']); <li<?php if ($a == 'page.php?name=about'){?> class="active"<?php }?>><a href="<?php echo $url; ?>/page.php?name=about" title="About">About</a></li> My class won't active while on page.php?name=about May I know how to ...

how does the header work in php?

Going through the php.net site, it had an example for header, which says would give me error. I copied it, and executed on on WAMP, but it didn't showed me any error, but did redirect to the site. <html> <?php /* This should give an error (but it doesn't!). Note the output * above, which is before the header() call */ header('Location:...

Is it a good practice to unset cookie expire parameter?

Hello all, I see the usage of the following code snippet: $cookieexpiry=(time()+21600); setcookie("rwphp","$cookieid",$cookieexpiry,"/",$_SERVER["HTTP_HOST"],0); unset($cookieexpiry); Q1> My question is whether or not this is a good practice to unset $cookieexpiry. Q2> In general cases, when should I unset variables? Th...

WordPress list categories for each author function + call to a member function on a non-object error

Hi, I'm writing a custom wordpress list authors function and am trying to add a function to list the categories that the author has posted in (this is not native to wordpress)... I found the following code in a WordPress forum (http://wordpress.org/support/topic/how-do-ilist-categories-an-author-has-wrote-in-on-authorphp)that supposedly...

PHP error_log errors to MySQL

Hi, In a previous ticket i asked about logging PHP errors in MySQL which gives me: function myErrorHandler($errno, $errstr, $errfile, $errline) { // mysql connect etc here... $sql = "INSERT INTO `error_log` SET `number` = ".mysql_real_escape_string($errno).", `string` = ".mysql_real_escape_string($e...

php returning mixed data types - good or bad

When returnign values in php is it considered good or bad practivce to return mixed data types. Im working on a project where i am constantly being faced with methods that wither return and id number or null. Im handling the null value by checking for null and returning -1 if is null. Another situation where i find myself in a lot is ...

cakephp accessing view attributes/variables from within a helper

is there a reasonable way to access the view attribute "passedArgs" (or any similar) /* view */ $this->passedArgs from within a Helper? I'd be happy to customize the _construct() of the helper or to customize the app_helper... but I don't want to have to pass $this->passedArgs into the helper on every view or usage. ...

make switch use === comparison not == comparison In PHP

Is there anyway to make it so that the following code still uses a switch and returns b not a? Thanks! $var = 0; switch($var) { case NULL : return 'a'; break; default : return 'b'; break; } Using if statements, of course, you'd do it like this: $var = 0; if($var === NULL) return 'a'; else return 'b'; But for more complex ex...

Convert PHP Date to Time

How can I covert this PHP date string: Thu 19th Aug 2010 @ 7:52PM to this: 1282247549 Which is done by: gmdate("D jS M Y @ g:iA", $row['project_deadline']) The timestamp is from the database with the stored time() function ...

Best US based credit card payments solution with PHP APIs

Possible Duplicate: Credit card payment gateway in PHP? I am looking for a solid credit card solution and we are not interested in PayPal. I am currently unsure about the volume of transactions. Someone suggested merchantone but after looking at some reviews i have my apprehensions. Idealling something around a ~2% transaction...

How to get a form select to come back with the option value, to be then used with a PHP if statment?

<?php $home = "/index.php"; $aboutus = "/aboutus.php"; $contact = "/contact.php"; $contact_reply = "/contact_reply.php"; $current = $_SERVER['REQUEST_URI']; if ($contact==$current) { print "&nbsp;"; } else { if (isset($_POST["op"])){ $message = ""; foreach ($HTT...

smtp configuration for php mail

I am sending mails from my website by using php mail function. But now it is not working and I contacted our hosting team then they told me to use smtp as they did some changes in server. I don't know how to do it. Current code(with php mail function) is as follows, can anyone help me about the changes wchich I have to do with this. <?p...