Skip to content

Get program name for PID using PHP

I am attempting to do something that is a little risky. Its a private script, but i want to add some security so I don’t accidentally enter an invalid PID. Currently if a script hangs it will lock …

Laravel: HTML in notification

I’m using the default notification system (Laravel 5.3) to send an email. I want to add HTML tags in message. This does not work (it displays the strong tags in plain text): I know it’s normal because text is displayed in {{ $text }} in the mail notification template. I tried to use the same syste…

Laravel Carbon Group by Month

Can anyone see what I’m doing wrong? I’m trying to output all the months but group them so they are unique. I’m getting the following back In my database I have five news articles all created_at 05/01/2017 so it’s right that I only get one response but I’m not getting the number …

PHP autologout inactive users

first time poster here, finally decided to make an account here after i used too many hours of my workday trying to solve this problem yesterday. so i have this “sessionCheck.php” script that is supposed to logout the user if he is inactive see code below. Right now the variable $inactive = 15; wh…

How can I create Associative array in Swift 3

Hi I am very new to Swift and am trying to use array. I want to create an array in swift3 similar to this PHP array as below: In the array above the country name are dynamic variables. Answer These are called dictionaries in Swift, and you can create one like this: EDIT: Swift is great at inferring the variab…

PHP MVC: How to add translation strings to views?

In my MVC view files, there exist strings I may have a translation for. In a file with access to the database (the model), I can do: $Lang->say(‘Welcome’); Here is what it’s doing: public …