There are times when you want to insert records in multiple tables. At the same time, you also want to ensure consistency. CodeIgniter simplifies MySQL transactions to perform Database operations on either all or none basis.
Tag » Array
3 Ways – Convert a PHP Object to an Array and Vice-Versa
Objects and arrays are essential parts of our day to day programming. PHP object to array and array to object conversions are quite common requirements. We are mentioning three ways that you can use to convert PHP object to an array.
3 Ways – Multidimensional Array to Object Conversion
There are few ways to convert a multidimensional array to object. If you’re a PHP developer then you have noticed that array to object conversion as a common need. So we’re mentioning three methods to convert a multidimensional or simple associative array to object. Like you, we’re also not a fan of typing braces and […]
5 Ways – Get Array Values by Matched or Excluded Keys Set
In this PHP tutorial, I’m providing 5 functions to get array values by keys. We have an associative array and an indexed array of few keys. Further, we want to get an array that has matched keys from the indexed array and corresponding values from the associative array. Conversely, we might wish to return an array with […]
Bootstrap 4 Carousel Full-screen Background Slider – PHP
Bootstrap 4 offers carousel integration with slide and fade effects. We can turn the Bootstrap 4 carousel in a full-screen slider with help of available classes and custom rules. Mostly you can see them as background image responsive sliders that cover the entire viewport.
Custom Breadcrumb Navigation using Yoast SEO Plugin
Yoast SEO is one of the most popular WordPress SEO plugins. The plugin offers a breadcrumb navigation feature to put on your WordPress website. However, sometimes we wish to grab these breadcrumb items in an Array.
3 Ways to Change Array Key without Changing the Order in PHP
You can change array key too easily but doing it without changing the order in PHP is quite tricky. Simply assigning the value to a new key and deleting old one doesn’t change the position of the new key at the place of old in the array.
Mega Menu – Multi Column Container in Bootstrap 4 Nav Dropdown
Want to convert a Bootstrap 4 nav menu dropdown to a multi column container or mega menu? Or need a navbar that breaks navigation links into responsive Bootstrap 4 columns, even in WordPress. Check the attached image to know what I have meant.
Find object by value in array of objects
In PHP we either create objects and their array, or database returns array of objects as result-set of some query. There we might need to find an object which have a particular property-value pair. There is no direct function available in PHP to perform the same so I’m explaining here how can we find object by value in array of objects by using a foreach loop.
Getting all element values using jQuery
Many times we face the problem of getting all the form controls or elements values of a long form. Because sometime getting so many controls by their id or name is very typical that make a long list.
So we need to opt a short way for getting all element values using jQuery. I have described three ways in this article.