I am not familiar with the character encoding. I have a ISO-8859-1 string(Big5). After i convert it to UTF-8 by the utf8_encode() function, garbage characters are shown in the HTML. Finally, i found another way to convert Big5 to UTF-8.
I was working on a legacy CMS which has a HTML form with ISO-8859-1 encoding. I found that whenever i got an Apostrophe (‘) in the string, the data cannot be persisted.
I guess it should be some encoding problem which makes the database fail to persist the data. So i try to use the PHP str_replace function to replace those Apostrophe but it has never replaced them successfully.
Recently, i was working on setting up a Ubuntu 8.04 LTS (Handy Heron) server. i found that the PHP installed by apt-get is 5.2.4-2ubuntu5.12 and the PHP GD Library is not up-to-date and caused a warning in the Drupal report. I have to download the latest and stable packages in order to solve the problem.
Luckily, i found a very useful and up-to-date Debian repositories for my Ubuntu server. You could find the latest stable LAMP packages there. It is called Dotdeb. Just complete the following steps then you can connect to the Dotdeb repositories. Continue reading Linux – Get The Latest LAMP Package→
MAMP is Apache, MySQL and PHP runs on Mac. For Mac users, it is very convenient to use the MAMP package such that they don’t need to install the those application one by one. Moreover, MAMP package also bundled with some other useful programs as well as libraries such as phpMyAdmin and the PHP GD library. For more information, you can refer to the MAMP website.
During the installation, you can include the MAMP control panel into you Mac Dashboard. This is quite helpful for you to start and stop the server. you can also pick either PHP4 or PHP5 by switching to the back panel by clicking the i button which is located under the Apache label on the front panel. Continue reading MAMP – Introduction→
Update @ 2016-01-25: The following sample code may be outdated. please try the new sample code from paypal as stated in this comment.
PayPal Payment Data Transfer (PDT) provides a simple way for gathering the PayPal transaction details after the payment. You can even make use of it to trigger any post-transaction action. This article guide you how to test your PDT flow in PayPal Sandbox Continue reading PayPal – Payment Data Transfer Sample Code→
Update @ 2014-03-10: If the following piece of code doesn’t work, you could try the comment written by karmaprod.
Update @ 2014-01-17: You may need to change the PHP_EOL setting in Windows environment as suggested by Rene.
Update @ 2015-02-13: Replace all “/r/n” to PHP_EOL as suggested by Rene and Tomas for windows environment and sending image attachment.
By default, the PHP mail() does not support sending email with attachment. In order to send an attachment, u can either use the PEAR package or PHPMailer. But in reality, the hosting server may not provide these kinds of third party libraries. Continue reading PHP – Send Attachment with PHP mail()→