My index page has a two column layout. In the left I have several icons (links) and in the right the dynamic content. Every time I click in one icon of the left I would like to show related …
Codeigniter: SMTP mail not working
I’m trying to set up a contact form, and I’m struggling to get it working with the SMTP configuration in CI. However I’ve successfully tried with the basic ‘mail’ config. To cut it short, I’m doing …
Decoding JSON in Twig
Is is possible to decode JSON in twig? Googling doesn’t seem to yield anything about this. Does decoding JSON in Twig not make sense? I’m trying to access 2 entity properties on an Symfony2’s entity …
How to call array_map() without using a closure
I have something like this: What I want to do is to use strlen($string) directly in array_map, but when I try it it won’t work.. Why is the reason? Something like this: Answer Your syntax is a little off:
Select from multiple tables with laravel fluent query builder
I’m re-writing some PHP/MySQL to work with Laravel. One thing I would like to do is make the DB queries more succinct with the Fluent Query Builder but I’m a bit lost: SELECT p.post_text, p….
Check if specific input file is empty
In my form I have 3 input fields for file upload: How can I check if cover_image is empty – no file is put for upload? Answer You can check by using the size field on the $_FILES array like so: (I also check error here because it may be 0 if something went wrong. I wouldn’t use name for
Calling console command within command and get the output in Symfony2
I have a few console command in Symfony2 and I need to execute one command from another command with some parameters. After successfull execution of the second command I need to get the result (as an array for example), not the display output. How can I do that? Answer Here you can have a basic command insideā¦
Why is my Symfony route is not working?
I made a new Symfony2 bundle and deleted the Acme bundle. Then I created a new Controller (MainController.php): <?php namespace MyBlogBundleController; class MainController extends Controller {…
How can i secure this API in an APK file
I am currently developing an api for a website i run. The api will be used in a number of places, and one of those places is an Android app. It’s purpose is to allow users to login, and and download files. I have the api build, and it will be using HTTPS so all of the data is fine
Why preg_match() returns first match at index 1 (not 0) of returned array?
Im working on small website scraper with cURL. I decided to use preg_match to find header and article content. This is my code: I was experimenting with it and I found, that if there is one match – it returns it in array at index 1, not 0. Edited question: Why is this 1, not 0? Im doing something wrong?