tag:blogger.com,1999:blog-4454890914416926782024-03-05T11:32:30.291+01:00azurepopcornOptimize LifeUnknownnoreply@blogger.comBlogger13125tag:blogger.com,1999:blog-445489091441692678.post-55479417008121784552020-05-25T20:02:00.001+02:002020-05-25T20:03:32.581+02:00Measuring PHP Execution Time$mt = microtime(TRUE);
foreach($y as $k => $v) {$z->$k = $v;}
$a = microtime(TRUE) - $mt;
print "Execution Time: " . ($a) . "\n";Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-445489091441692678.post-90818220379374118722020-02-14T16:07:00.001+01:002020-02-14T18:39:38.728+01:00Are PHP Objects passed as a value?
Yes they are, but as a copy of a value of a reference. Same as in Java.
Example below is showing how the Person type arguments are passed. In the point of entry of the methods changeName() and changeNameToNull(), $person reference copy is made.
From that point, a new reference can change the $person object in changeName(), as it has a reference to it. On the other hand, changeNameToNull() Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-445489091441692678.post-76096263075443851402018-08-22T12:51:00.002+02:002020-12-16T15:50:30.375+01:00PHP Foreach Key by Pointer
Here is a way to add a new elements to a new array in PHP foreach function, by reference on a new element.
$items = Item::get();
$formattedItems = [];
foreach ($items as $item) {
$fm = &$formattedItems[];
$fm['id'] = $item->id;
$fm['label'] = $item->label;
$fm['icon'] = $item->icon;
}
var_dump($formattedItems);
Simple and clean.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-445489091441692678.post-48429569917150776582018-08-22T12:42:00.001+02:002018-08-22T12:42:09.251+02:00Get Service Instance Anywhere in LaravelInject Service Instance by Constructor
Code Example:
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class MyController extends Controller
{
protected $client;
public function __construct(Client $client)
{
$this->client = $client;
}
public function store(Request $request)
{
$response = $this->client->message()->send([Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-445489091441692678.post-3729121875597592412018-06-05T15:52:00.005+02:002020-05-09T21:13:30.858+02:00PHP - remove all except letters, numbers, dashes and blanks
PHP - remove all except letters, numbers, dashes and blanks for various cases, like cleaning user input for DB storage, further execution and making it safe.
It's very easy to remove special characters.
$search = preg_replace('/[^a-zA-Z0-9 -]/', '', $search);
Also, if you would like to check if search string contains some characters, it's like this:
if (preg_match('/[^Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-445489091441692678.post-54725003130807173482018-02-28T20:08:00.000+01:002019-08-02T14:20:19.452+02:00Image Meta Data&EXIF Removal
Image meta data can contain some information which image uploader wouldn't like to share with broad audience. Luckily, there is a great tool which strips all meta data and EXIF data. It works with JPG and PNG image formats.
There are a lot of tools claiming to clean meta data from image, but this one called JPEG & PNG Stripper works just awesome! It provides super easy and Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-445489091441692678.post-562656706221329112012-12-07T21:40:00.000+01:002019-08-02T14:25:32.233+02:00Lee Scratch Perry movie - Vision of paradise
Well, this isn't Lee's movie, it's about the Lee Scratch Perry! Volker Schaner, a German guy is making the movie about Lee's life for last 13 years! Right now the project came to the final phase, where it should be done some final editing which costs minimum $40.000 $20.000.
The movie can be seen as a guide for how to change the world with music –
with a positive attitude, Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-445489091441692678.post-57557628744098580832012-03-10T20:00:00.000+01:002018-03-01T12:10:01.057+01:00Homemade bread
Dough
Baked bread
Of course, if you wish you can use the same dough to make pizza, this one is with onions.
Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-445489091441692678.post-68000091097941974192012-02-28T22:40:00.002+01:002018-03-01T12:11:03.512+01:00We couldn't reach you by email. Please enter a valid email address - FacebookRecently I've got error a message on facebook.com which says "We couldn't reach you by email. Please enter a valid email address". Personally I don't use nor like Facebook, but it is very valuable tool for some kinds of web promotions.
Slightly looking over the answers on this error message "We couldn't reach you by email. Please enter a valid email address" didnt give me a proper reason for Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-445489091441692678.post-48600239626972335482012-02-05T18:34:00.002+01:002018-03-01T12:11:13.183+01:00AdSense interface in custom language
Hi folks, this post is dealing with unwanted language selection of AdSense interface. If you want to set back your AdSense interface in custom language, just pop in.
I've experienced unwanted language selection in AdSense interface and wanted to get it back to English. Accidentally I've clicked on some link to AdSense, but the URL contained language sign which I didn't saw at the time. Unknownnoreply@blogger.com4tag:blogger.com,1999:blog-445489091441692678.post-8597801455970288602011-09-13T11:06:00.003+02:002018-03-01T12:12:09.984+01:00Heroes 3 on Windows 7 / 64 bitLegendary game Heroes of Might and Magic 3, originally dated from 1999 is still very popular and is being played even today. Playing this game on Windows 7 / 64 bit was unable due to problem which was.........................Windows registry!
According to many previous "solutions", the problem was on backward compatibility built in Win7, so advises were to check Winows XP compatybility for .exeUnknownnoreply@blogger.com3tag:blogger.com,1999:blog-445489091441692678.post-61718561320734259132010-12-08T16:13:00.014+01:002018-03-01T12:11:46.482+01:00Olive leaf teaSo, you are interested in Olive leaf tea? The Olive leaf tea I make, is made of hand picked leafs in Montenegro, Europe. First, I have picked leaves from the olive tree, dried it, chopped it, and take it to the glass jar with the tiny holes on the cap.
It should be a little more leaves in the cup of boiled water, and it should remain a little bit longer in the water, Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-445489091441692678.post-91327740144014903432010-11-26T00:34:00.003+01:002018-03-01T12:12:41.601+01:00Google Chrome memory leak - flash plugin problemHello folks, i have been using Firefox for a few years, and i was adoring the orange fox and its very useful plugins. I remember , 5 years ago, i went on FF from Internet Explorer 6 because of plenty IE security and viruses problems.
Firefox in following years became too slow for my computer, which isn't to bad - AMD Turion X2, 3 gigs of RAM, ATI chip set, 7200rpm Unknownnoreply@blogger.com4