Category Archives: PHP-Tips
Get multiple arrays values simultaneously in single loop
$a = array(1,2,4); $b = array(’a',’b',’c'); foreach (array_map(null, $a, $b) as $v) { list($v1, $v2) = $v; echo $v1 . $v2 ; }
Run PHP from HTML – .html as .php – Execute PHP in .html
How can I execute PHP code on my existing myfile.html page?: When a web page is accessed, the server checks the extension to know how to handle the page. Generally speaking if it sees a .htm or .html file, it … Continue reading
Insert user in Support suite using CodeIginiter
Paste following code in end of database.php located in config folder $db[’db_support’][’hostname’] = "localhost"; $db[’db_support’][’username’] = "dbname"; $db[’db_support’][’password’] = "password"; $db[’db_support’][’database’] = "supportsuite_databasename"; $db[’db_support’][’dbdriver’] = "mysql"; $db[’db_support’][’dbprefix’] = ""; $db[’db_support’][’pconnect’] = TRUE; $db[’db_support’][’db_debug’] = TRUE; $db[’db_support’][’cache_on’] = FALSE; $db[’db_support’][’cachedir’] = … Continue reading
A Tip in codeigniter to join two tables have same coloum name id
A Tip in codeigniter to join two tables have same coloum name id $this->ci->db->select("users.*", FALSE); $this->ci->db->select("user_profile.*", FALSE); $this->ci->db->from("users"); $this->ci->db->join("user_profile", "user_profile.user_id = users.id",’inner’); $this->ci->db->where(array(’users.id’=>$user_id), NULL, FALSE); Users table has id and other table User_profile have id and user_id now users’s id … Continue reading
true v/s TRUE is actually case insensitive : PHP Tips
Fact is : To specify a boolean literal, use the keywords TRUE or FALSE. Both are case-insensitive. We assume in moodle: http://docs.moodle.org/en/Development:Coding_style#Booleans_and_the_null_Value Booleans and the null Value Use lower case for true, false and null. We assume in CodeIgniter: http://codeigniter.com/user_guide/general/styleguide.html#true_false_and_null … Continue reading