Skip to content

Tag: php

Laravel change input value

In laravel, we can get the input value via Input::get(‘inputname’). I try to change the value by doing this Input::get(‘inputname’) = “new value”;. But then, I get the error message saying Can’t use function return value in write context. Is it possible for us change …

How to convert HTML to JSON using PHP?

I can convert JSON to HTML using JsontoHtml library. Now,I need to convert present HTML to JSON as shown in this site. When looked into the code I found the following script: Now, I am in need of using the following function in PHP. I can get the HTML data. All what I needed now is to convert the JavaScript

Laravel: Get base URL

Simple question, but the answer seems quite hard to come by. In Codeigniter, I could load the URL helper and then simply do to get my site’s URL. Is there an equivalent in Laravel? Answer You can use the URL facade which lets you do calls to the URL generator So you can do: You can also use the applicat…

Need a script File to clear Cache Tables in a Drupal Database

I need to take a dump of MySQL Database, i usaully do these manual steps do Perform dumping.     login to phpmyadmin     select database     select sql tab     paste these lines         TRUNCATE watchdog;         TRUNCATE cache; and         TRUNCATE cache_admin_menu; And click on OK to clean the cache. I need…

How format number value in php?

I want format number as style ‘00000’ ex: How format number in php? Answer You should use str_pad : https://www.php.net/manual/en/function.str-pad.php