Skip to main content
PHP Blog

PHP Blog

  • How to Resize an Image In Codeigniter? preview
    6 min read
    To resize an image in CodeIgniter, you can use the Image Manipulation Library that comes bundled with the framework. First, load the library by including the following line in your controller:$this->load->library('image_lib');Next, you can initialize the library with the desired image to be resized by using the following code snippet:$config['image_library'] = 'gd2'; $config['source_image'] = '/path/to/image.

  • How to Query Mongodb With "Like" In Codeigniter? preview
    3 min read
    To query MongoDB with "like" in CodeIgniter, you can use the $regex operator. This operator allows you to perform pattern matching similar to the SQL "LIKE" clause.In CodeIgniter, you can use the MongoDB query builder to construct your query. You can specify the "like" pattern using the $regex operator along with the desired pattern.

  • How to Call A Postgresql Function In Codeigniter? preview
    4 min read
    To call a PostgreSQL function in CodeIgniter, you can use the query() method of the database class. First, you need to establish a database connection in your CodeIgniter application using the database configuration file. Once the connection is established, you can use the query() method to execute your PostgreSQL function by passing the function call as a string parameter to the method.

  • How to Post Data From Node.js to Codeigniter? preview
    7 min read
    To post data from Node.js to CodeIgniter, you can use the request module in Node.js to make an HTTP POST request to a CodeIgniter controller.First, install the request module by running the following command in your Node.js project directory:npm install requestNext, in your Node.js script, require the request module and use it to make a POST request to the CodeIgniter controller.

  • How to Display Record By Id In Codeigniter? preview
    3 min read
    To display a record by ID in CodeIgniter, you can use the built-in functions provided by the framework. First, you need to load the database library in your controller. Then, you can use the model to fetch the record based on the ID passed as a parameter. Once you have retrieved the record, you can pass it to the view file to display the data as needed. Make sure to handle errors if the record with the specified ID is not found in the database.

  • How to Send Values From Controller to Model In Codeigniter? preview
    9 min read
    In CodeIgniter, you can send values from the controller to the model by loading the model in the controller and passing the data as parameters to the model functions.

  • How to Use Json_contains With Codeigniter? preview
    6 min read
    To use json_contains with CodeIgniter, you need to write a custom query using CodeIgniter's Query Builder class.First, load the database library in your controller or model. Then, use the select() and where() methods of the Query Builder class to build the query.

  • How to Unlink Files With Codeigniter? preview
    5 min read
    In CodeIgniter, unlinking files is the process of removing files from the server directory. To unlink files with CodeIgniter, you can use the unlink() function provided by PHP.First, you need to specify the file path of the file you want to unlink. You can use the FCPATH constant in CodeIgniter to get the base path of your application. Then, concatenate the file path with the file name you want to unlink.Next, use the unlink() function to delete the file.

  • How to Create New Session In Laravel? preview
    7 min read
    To create a new session in Laravel, you can use the session() helper function provided by Laravel. You can simply call this function and set the session data by passing an array of key-value pairs as arguments. For example, you can store a user's name in the session by calling session(['name' => 'John Doe']).To access the session data later on, you can use the session() function again with the key of the data you want to retrieve.

  • How to Make Restful Api In Codeigniter? preview
    5 min read
    To create a RESTful API in CodeIgniter, you need to first set up your CodeIgniter project and install the necessary libraries. Then, you'll need to define your routes, controllers, and models for handling different API requests and responses.You can use CodeIgniter's built-in functionality for creating RESTful endpoints by extending the default controller and using HTTP methods such as GET, POST, PUT, DELETE, etc. to handle different types of requests.

  • How to Validate Multiple Sheets In Laravel Excel? preview
    6 min read
    To validate multiple sheets in Laravel Excel, you can use the SheetsValidation interface provided by Laravel Excel. This interface allows you to define validation rules for each sheet in your Excel file.To implement sheets validation, you can create a custom validation class that implements the SheetsValidation interface. Within this class, you can define the validation rules for each sheet by using Laravel's validation methods.