Php money_format — Formats a number as a currency string

money_format — Formats a number as a currency string

[php]<?php

$number = 1234.56;

// let's print the international format for the en_US locale
setlocale(LC_MONETARY, 'en_US');
echo money_format('%i', $number) . "\n";
// USD 1,234.56
[/php]



[php]
// Italian national format with 2 decimals`
setlocale(LC_MONETARY, 'it_IT');
echo money_format('%.2n', $number) . "\n";
// Eu 1.234,56

// Using a negative number
$number = -1234.5672;

// US national format, using () for negative numbers
// and 10 digits for left precision
setlocale(LC_MONETARY, 'en_US');
echo money_format('%(#10n', $number) . "\n";
// ($        1,234.57)

// Similar format as above, adding the use of 2 digits of right
// precision and '*' as a fill character
echo money_format('%=*(#10.2n', $number) . "\n";
// ($********1,234.57)

// Let's justify to the left, with 14 positions of width, 8 digits of
// left precision, 2 of right precision, withouth grouping character
// and using the international format for the de_DE locale.
setlocale(LC_MONETARY, 'de_DE');
echo money_format('%=*^-14#8.2i', 1234.56) . "\n";
// Eu 1234,56****

// Let's add some blurb before and after the conversion specification
setlocale(LC_MONETARY, 'en_GB');
$fmt = 'The final value is %i (after a 10%% discount)';
echo money_format($fmt, 1234.56) . "\n";
// The final value is  GBP 1,234.56 (after a 10% discount)

?>

[/php]

14/01/2015

Cpanel SSL Certificate Configration

Requirement :
  • Unique ip address should be assigned to "www.yourdomain.com"  from WHM 
  • to make sure wheter it is assigned or not   enter ip address to web browser url  if the website opens that means it has been assigned.
  1. First, decide on what URL you'd like to use with your SSL certificate. The most popular choice is:
www.yourdomain.com but some people prefer yourdomain.com It is recommended that the www.yourdomain.com form is used since then the certificate will work with both https://www.yourdomain.com and https://yourdomain.com
  • Next, you need to generate a private key and a CSR (Certificate signing request). This can be done via cPanel. Login to cpanel and go to the section labeled "SSL Manager"
  • Click on the "Private Keys (KEY)" icon.
  • In the "Private Keys" screen, go down to the "Generate a New Key" section of the screen. Type in your URL (or select it from the drop-down) that you picked in Step 1. Remember, www.yourdomain.com is recommended. Make sure you do not include "https://" in the field for your domain name.
  • In the 'KeySize' dropdown, select 2048.
  • Click the 'Generate' button.
  • Go back to the "SSL Manager" screen and click on the icon for "Certificate Signing Requests (CSR)"
  • Use the form labeled "Generate a New Certificate Signing Request" to generate a CSR. Fill in the fields with the appropriate information. The passphrase has to be alpha-numeric. IMPORTANT! Be absolutely sure to create a passphrase you will remember (There is NOTHING we can do to recover this passphrase if forgotten). Fill in the other fields with the appropriate information.
  • Click the 'Generate' button.
  • Now you have a 'CSR' suitable for submission to the signing authority.
  • Click on the link in the email you received titled 'SSL Certificate Configuration Required'.
  • Choose your web server type. For cpanel accounts the webserver type is Apache+ModSSL
  • Paste the CSR you generated into the CSR text box.
  • Complete the Administrative Contact Information and click 'Click to Continue'.
  • On the next page, select the email address that will receive an approval email and click 'Finish'.
  • If the domain you are associating with this SSL Certificate has WHOIS Protection (also called ID Protection or Privacy Protection) the default email address may not be suitable. Please choose an email address that is working and accessible.
  • After completing the above process, your SSL cert will be emailed to you.
  • Go back to the cPanel "SSL Manager" and click on the "Certificates (CRT)" Icon.
  • Paste in your new certificate to the text area under "Upload a new Certificate" and click the "Upload" button.
  • You're almost done -- The SSL Manager stores your SSL info, but it does not install it into the web server. To complete the installation process, go back to the cPanel main screen and click on the "SSL/TLS Manager" Icon. Then choose "Activate SSL on Your Web Site (HTTPS)" (Note: If you don't see an "Activate SSL on Your Web Site (HTTPS)" option, it's probably because your account doesn't have a private IP address. You will need to open a request with our Support department to get a private IP assigned to your account. There is an additional charge for each IP).
  • If there is a currently active SSL host, click the 'Delete Host' button and confirm the deletion.
  • In the "SSL Installer" screen, first select your domain from the drop-down menu, then paste in the contents of your Certificate, Private Key, and your CA Bundle (CA Bundle may also be called Intermediate Certificate). Some of the fields may populate automatically when you select the domain. Pasting in the ones you are sure are correct is the best way to ensure success in this step.
  • Click the "Install Certificate" button to install your SSL certificate.
 

14/01/2015