Posts

How to get second last array in php?

lets take an example like this is your array Array ( [0] => 14802 Stony Plain Rd NW [1] => Edmonton [2] => AB T5N 3S5 ) and you want to get second last array " Edmonton" then simple use this array like this end ( $array ); $z = prev ( $array ); this is effective and you can get second last array. :)

How to get all record of yesterday from table in mysql?

Image
How to get all record of yesterday from table in mysql? if you are looking for sql query which will return you all record of yesterday. So please take a look on this query and replace the content according to your table Let your table is like this: So your query will be like this select id from tbl_download  WHERE date(download_date) = ADDDATE(current_date,-1) Happy coding :)

How to change the content of button of comment section in drupal?

How to change the content of button of comment section in drupal? if you want to change the content of button of comment box section submit button so follow this path yoursite/modules/comment and open this file  comment.module and search the keyword in this page  $form['submit'] = array('#type' => 'submit', '#value' => t('Save') replace the word Save to your desire word it will show on your comment section submit button.

How to remove "More information about formatting options" from drupal?

If you are looking for drupal help that.... How to remove "More information about formatting options" from drupal? so you come on  right place Follow your theme path choose your theme and open template.php Search this function phptemplate_filter_tips_more_info in your template.php file and check that if it is exist or not If exist so replace this function from last one function phptemplate_filter_tips_more_info() { return ''; } if not exist so please paste this function in your template.php anywhere where ever you want /** * Implementation of theme_filter_tips_more_info(). * Used here to hide the "More information about formatting options" link. */ function phptemplate_filter_tips_more_info() { return ''; } Thanks for read my blog :)

How to extract or fetch urls from text in PHP?

How to show url as a link from a text in php. this code will return you the link from a text . simply copy and paste this in you php file and call the function.  <?php             function make_clickable_string_url($text) {             return preg_replace_callback(             '#\bhttps?://[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/))#',             create_function(             '$matches',             'return "<br/><a href=\'{$matches[0]}\'>{$matches[0]}</a>";'             ),             $text             );             }         ?> it will return you the string as well as return a link of url which exist in content

How can I to search in mysql within a table of comma-separated values?

I have a MySQL table which contains comma-separated values like 2,4,56,125 and i want to search record which have a particular value. so how can i search in mysql  simple copy and paste this code in your table and change your table name and field name and search keyword. SELECT * FROM table WHERE FIND_IN_SET(search_keyword , field_name)  like SELECT * FROM tbl_font WHERE FIND_IN_SET(2,cat_id)

How to use 301 url redirect in magento via htacess?

Make a .htaccess file on root of your magento paste this code on this file and change path of site..... <IfModule mod_rewrite.c> DirectoryIndex index.php RewriteEngine on RewriteCond $1 !^(index\.php|media|skin|js|robots\.txt) RewriteRule ^typefaceselection.aspx$ /insignedesigncom/index.php/$1 [R=301,L] RewriteRule ^contact.aspx$ /insignedesigncom/index.php/contacts/$1 [R=301,L] RewriteRule ^thankyou.aspx$ /insignedesigncom/index.php/thankyou.aspx/$1 [R=301,L] </IfModule>