stripos – PHP String Functions
Syntax : stripos ( string, search_string, start ); Description : It’s an inbuilt function of PHP. stripos() function find the position of the first occurrence of a search_string in a string....
Syntax : stripos ( string, search_string, start ); Description : It’s an inbuilt function of PHP. stripos() function find the position of the first occurrence of a search_string in a string....
Creating a MySQL database via SSH:- First of all you need to have the server root access to begin creating database using the SSH command line. Then follow the steps...
Call Core Template File In Magento: When working with custom HTML integration in Magento you need to call core template files in Magento. There are two steps to do this...
Delete all ‘Url Rewrite Management’ URLs: To remove all the unnecessary URL’s that are being created by magneto backend you need to do this via URLRewrite management. These are the...
Magento Sort Order of Collection With a sorted collection you can display list of objects like products in a specific order. The below code will sort the collection in descending...
Syntax : string stripcslashes ( string); Description : It’s an inbuilt function of PHP. stripcslashes() function un-quote string quoted with addcslashes(). Recognizes C-like \n, \r …, octal and hexadecimal representation. Note : We can use this...
Syntax : string stripslashes ( string); Description : It’s an inbuilt function of PHP. stripslashes() function un-quote string quoted with addslashes(). Note : We can use this function to clean up data...
Magento Add Custom CSS and Javascript to Home Page or specific CMS page Magento is a complete package and allows custom changes to its layout with easy addition of custom...
Get Table Name in Magento : You can easily add table in Magento by using the following code. Suppose you need to get table name category_product. Table Name in Magento :...
Syntax : substr ( string, start_position, length ); Description : It’s an inbuilt function of PHP. substr() function will return part of a string. Parameter : string – This is a Required parameter....
String strtr ( string, from, to ); OR String strtr ( string, replace_array ); Description : It’s an inbuilt function of PHP. strtr() function translate characters or replace strings. In case if...
Syntax : substr_count ( string, substring, start_position, length ); Description : It’s an inbuilt function of PHP. substr_count() function counts the number of times a substring comes in a string. Note: The...
Syntax : substr_compare ( string1, string2, start_position, length, case_insensitivity ); Description : It’s an inbuilt function of PHP. substr_compare() function will compares two strings from a specified start position. It do the binary...
Syntax : substr_replace ( string, replacement, start, length ); Description : substr_replace() function will replace text within a part of a string. As the name suggest, it works similarly as its...
Syntax : uniqid (prefix, more_entropy) ; Description : The uniqid() function generates a unique ID based on the microtime (current time in microseconds). This is an inbuilt function of PHP. ID...
In the below example, we will learn how to get the shopping cart information in Magento with respect their respective values of cart items, subtotal, grand total, billing & shipping...
Magento Get Last Order Id : You can get last order Id in magento by using the following code in Model. $orders = Mage::getModel(‘sales/order’)->getCollection() ->setOrder(‘increment_id’,’DESC’) ->setPageSize(1) ->getFirstItem(); echo $orders->getEntityId() This...
Syntax : wordwrap ( string, width, break, cut ); Description : wordwrap() function will Wraps a string to a given number of width using a string break character. Parameter : [table caption=”” width=”100%”...
Magento get coupon code applied on cart code You can use the following getCouponCode method to apply coupon code on cart in Magento $coupon_code = Mage::getSingleton(‘checkout/session’) ->getQuote()->getCouponCode(); You can follow...
Syntax : string nl2br( string , use_xhtml); Description : It is an inbuilt function of PHP. nl2br() function inserts HTML ( <br> or </ br> ) line breaks before all...