Programming
How to add quote to string delimited by comma in PHP
Sometimes we will have a list of string delimited by comma, e.g., a,b,c,d
, and we would like to add quote or single quote around each element, e.g., 'a','b','c','d'
. It is possible to do so in a line.
- sugree's blog
- Add new comment
- Read more
- 3967 reads
How to create and verify SSHA hash using PHP
There are so many hash. SHA1 is one of them which is widely used in recent years even though it is not safe to use right now. By the way, it is still the default hash function for storing password in LDAP especially OpenLDAP. In order to develop a website with LDAP authentication manually against POSIX account, SSHA hash function or SHA1 is the easiest solution.
- sugree's blog
- Add new comment
- Read more
- 8948 reads
Create Dynamic Select in ABAP/4
- thitima's blog
- 1 comment
- Read more
- 4771 reads
How to display user's fullname in Drupal
By default, Drupal will have only username and password for such a user. Whenever username is displayed, it will try to call a theme funtion namely username
by specified $node
. If you want to display user's fullname instead, you have to customize a little bit.
- sugree's blog
- Add new comment
- Read more
- 5544 reads
How to list nodes in multiple taxonomies in Drupal using Subquery
I found a good question regarding PHP snippet for Drupal. Usually, we will list nodes in multiple taxonomies using OR operator. However, you might need to list using AND operator which nodes must be in all specified taxonomies instead. It is not easy to do so using plain SQL. The straightforward solution is to use subquery.
- sugree's blog
- Add new comment
- Read more
- 2177 reads
How to manually sort table in Drupal
Drupal provides powerful and flexible built-in table sort functionality. However, it will only work with database query through standard db_query()
and pager_query()
. In many cases, rows are fetched from external system, e.g., mailbox. We may add a few lines to get the same behavior.
- sugree's blog
- Add new comment
- Read more
- 3833 reads
Recent comments
3 years 29 weeks ago
3 years 34 weeks ago
3 years 35 weeks ago
3 years 35 weeks ago
3 years 35 weeks ago
3 years 38 weeks ago
3 years 38 weeks ago
3 years 38 weeks ago
3 years 38 weeks ago
3 years 38 weeks ago