In yesterday Interview I was asked that how to reverse a string with out using any string function like strrev() or strlen(). I found this example on website but it gives error.is it possible to do …
Tag: php
Load Blade assets with https in Laravel
I am loading my css using this format: <link href=”{{ asset(‘assets/mdi/css/materialdesignicons.min.css’) }}” media=”all” rel=”stylesheet” type=”text/css” /> and it loads fine for all http requests But when I load my login page with SSL (https)…
WordPress – Blur Image on Upload
So I’m following the example given here (which I modified to only blur, no watermark), to make a blurred image in WordPress on upload. The problem is, that if the uploaded file is the exact same size, or smaller, than the set size, then WordPress will not generate an image, and hence no blurred one will…
Server sent events stopped (was previously working) reaching the browser
I have a bit of a mystery on my hands and would appreciate some assistance debugging this. I have this script: That opens up an event stream with this PHP file: All of this was working perfectly before and, to my knowledge, I haven’t changed a thing with either portion but for some reason my .onmessage …
Call to undefined function odbc_connect() php 7
I’m testing out php 7 and have come across this error: Fatal error: Uncaught Error: Call to undefined function odbc_connect() From the doc page: http://php.net/manual/en/function.odbc-connect.php …
Sorting Children in Laravel : How do I sort children by name?
Below is my controller code When I access my categories and its children in the view, the categories seem to be sorted by name but the children categories are not. How do I sort the children categories as well by name? Also, is it possible to sort the categories using a different criteria than the children eg…
Download file with ajax and php – readfile not working
I want to save a value to a txt-file and download it to the user. Right now, the value is being printed into the txt-file correctly, but the readfile function is not triggered, thus no downloading begins. The php, this code is located on the same page as the ajax call. The javascript, there is no url because …
Slim 3: how to access settings?
Before the Slim 3 is released, codes below work fine: settings.php, index.php MyClass.php But after the release, I get this error below: Notice: Undefined property: SlimApp::$settings in /… So I can’t use $app->settings anymore? What should I use then? Answer You can get settings like this:
Type hinting in PHP 7 – array of objects
Maybe I missed something but is there any option to define that function should have argument or return for example array of User objects? Consider the following code: <?php class User { …
Interpreting mysqldumpslow results
I have modified mysql config to log slow queries And interpreting them with mysqldumpslow. One of the results is as follows Question: what do the numbers in brackets mean? The query does take about 0.21s when run with mysql (or via mysql GUI’s); however when making a request to a page the time span is m…