Skip to content

Tag: php

Have PHP dump heap on OutOfMemory exception

I am currently debugging a script that constantly runs into OutOfMemory exceptions. It is run as a cronjob and usually runs fine, but when the cronjob wasn’t run for a while (for whatever reason) the script has to handle to many elements that queued up and will run into a OutOfMemory exception. From exa…

Print Currency Number Format in PHP

I have some price values to display in my page. I am writing a function which takes the float price and returns the formatted currency val with currency code too.. For example, fnPrice(1001.01) should print $ 1,000.01 Answer The easiest answer is number_format(). If you want your application to be able to wor…

php class to inline css styles?

I was over at MailChimp’s css inliner http://www.mailchimp.com/labs/inlinecss.php and I was wondering if there are any classes out there that can do this, I’d love to have it in my email code instead of going all the way over to MailChimp. Basically I’m looking for the code, behind the page …

“SMTP Error: Could not authenticate” in PHPMailer

I’m using PHPMailer in a Simple Script For Send Email’s Through Gmail, and I’m getting an “Unknown Error” (At least for me!): SMTP Error: Could not authenticate. Error: SMTP Error: Could not authenticate. SMTP server error: 5.7.1 Username and Password not accepted. Learn more at …

how to start ob_start inside a class?

im doing a little reasearch about minimalizing the html from php. like the problem is how do i call this ob_start(function) ? can we do like ob_start($this->compresssor()) ? ( ok i know it fails ) inside a class? anyone ?? Thanks for looking in. Adam Ramadhan Answer PHP uses an array(instance,function) rep…

How to add thumbnail to an article in Joomla?

Is there any extension that helps me to add a thumbnail manually to an article? Not those exts which do it on the fly using the first image in the article. I want to add it manually. Answer See related question. Look at there 2 components, you can achieve pretty much the same thing: K2 ZOO, from Yootheme I wa…

How to echo in PHP, HTML tags

I went through this before posting: How can I echo HTML in PHP? And I still couldn’t make it work. I’m trying to echo this: But I still can’t find a way to make the tags “” and ” disappear. What do I have to do? Answer Just put it in single quotes.