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 …
With strict types enabled, array_map converts types anyways
I’ve came across a really interesting bug in PHP 7.0.11 where declare(strict_types=1); enabled does not make the array_map() nor array_walk() aware of strict types. I read somewhere that by enabling strict types PHP also uses strict types in core functions, but this is not the case. Look at this example…
PHP split comma-separated values but retain quotes
I’m trying to split a string that contains comma-separated set of values. This can be achieved simply by using str_getcsv but I have an additional requirement where it falls short of. I need to retain …
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…
IP.Board – Single Sign On in php
I’m developing a small hand made web portal for a community and I want it to have a loggin system with IP.Board (easier for the end user). I have the forum and the app on the same hosting. For the …
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…
The Swift_Transport_MailTransport class is deprecated since version 5.4.5 and will be removed in 6.0. Use the Sendmail or SMTP transport instead
I’m using the SwiftMailer class to send mail using the php mail() function or SMTP depending on my app’s configuration (development or production). My code looks like this : // Default mailer: php …
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 …