Difference between echo and print in php

echo and print are both language construct in php, however print returns 1 but it is not a function.

Below mentioned usage of echo and print, both are valid

echo "Hello World"
print "Hello World"

echo("Hello World")
print("Hello World")

echo can output more than 1 string while print cannot(using comma separator)

echo "Hello", "world","I am Swapnesh";
print "Hello";
print "World";

How to send email to multiple recipients in magento


$postData['offemail'] = 'sendermail@gmail.com';
$templateId = 1;
$recipients = Mage::getStoreConfig(self::XML_PATH_EMAIL_RECIPIENT);
$recipients = explode(',' , $recipients);
array_push($recipients,$postData['offemail']);
$store = Mage::app()->getStore();
$translate = Mage::getSingleton('core/translate');
Mage::getModel('core/email_template')
->sendTransactional($templateId,
Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER),
array_values($recipients),
'Recipient Name',
array('data' => $postObject),
$store->getId()
);
$translate->setTranslateInline(true);

What to do when firefox consumes lot of memory

Being a developer i noticed that my firefox consumes lot of memory once it was started. Few of the points may be helpful for you to keep the memory little free –

  • Hide the bookmark and web developer toolbar as use not quite ofently using these. (try to use shortcuts for that ctrl+b for Bookmarking and F12 for web developer tool).
  • Restart your browser with add-ons disabled and check memory consumption (MENU -> HELP -> Restart with Add-ons disabled).
  • If you are heavily using the add-ons try to uninstall and remove the unnessary add-ons/plugins.
  • You can also edit “session” options in Firefox, only if you understand the technical risks.

System.out.print in php

System.out.print is totally valid in php likewise in JAVA. I ran this sample code and its working all fine in PHP 5.3.

$result = 5;
System.out.print(“This is a valid System.out.print with uppercase S”);
System.out.print(“<br>”);
system.out.print(“This is a valid system.out.print with lowercase s”);
System.out.print(“<br>”);
System.out.print($result);

How to remove suckerfish JS error

Add this line of code to suckerfish.js file

 

if (document.getElementById("nav") == null) return;

It looks like —

sfHover=function(){
if (document.getElementById("nav") == null) return;
var sfEls=document.getElementById("nav").getElementsByTagName("LI");
for(var i=0;i<sfEls.length;i++){
sfEls[i].onmouseover=function(){
this.className+=" sfhover"}
sfEls[i].onmouseout=function(){
this.className=this.className.replace(new RegExp(" sfhover\\b"),"");}
}
}
if(window.attachEvent)window.attachEvent("onload",sfHover);