The easiest way is to JSON-encode your object and then decode it back to an array: $array = json_decode(json_encode($object), True); you can traverse the object …
Read MorePHP
Codeigniter- $this->db->like is case sensitive
There is no case insensitive version of the like function. What you can do is transform both sides of the comparison to lower case, so …
Read MoreThe /e modifier is deprecated, use preg_replace_callback instead
I’m getting notices on server with PHP 5.5 preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead i’m not sure but it seems the entity_decode …
Read MoreJquery- Check if is valid price or not
Check the valid price in Jquery. If the price is valid or not.It returns TRUE or FALSE. function CheckValidPrice(price=0){ var tempPrice = Math.round(price * 100)/ …
Read MoreAccess database config variables from a helper in Codeigniter
By using Like this way you can access Codeigniter Files From Helper. $CI =& get_instance(); $CI->load->database();
Read MorePhp – How to Connect Database from Constant file in Codeigniter version 3.0
Here, Using this way you can connect with database from constant file. then you can access the tables. include(APPPATH.’config/database’.EXT); $conn = mysql_connect($db[‘default’][‘hostname’], $db[‘default’][‘username’], $db[‘default’][‘password’]); …
Read MoreJquery- on Form Submit Validate
On Form Submit Validate using Jquery <script type=”text/javascript”> $(document).ready(function() { $(“#shr_form”).on(‘submit’, function() { var dForm = $(this); var damount = dForm.find(“input[name=damount]”).val(); var dMsgElmnt= dForm.find(“#dmessage”); dMsgElmnt.html(”); …
Read MoreCheck if input is valid number in Jquery or Javascript
It Returns TRUE or FAlSE. If Valid Number It Returns True , Otherwise False. <script> function CheckValidPrice(price=0){ var tempPrice = Math.round(price * 100)/ …
Read MoreGet file content from a URL?
Get file content from a URL? $jsonData = json_decode(file_get_contents(‘https://chart.googleapis.com/chart?cht=p3&chs=250×100&chd=t:60,40&chl=Hello|World&chof=json’)); However, if allow_url_fopen isn’t enabled on your system, you could read the data via CURL as …
Read More.htaccess redirect http to https
use the following to redirect all pages of my domain from http to https: RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Read More