Jump to content

chhorn

Members
  • Posts

    115
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by chhorn

  1. if you dont have a redis server running, stick to using a file with the functions provided by @kicken - the logic is pretty easy

    # pseudo code
    if(file_age > 5 minutes) save api data to file;
    get data from file;

     

  2. the only hint i found was something like

    exec('powershell -c (New-Object Media.SoundPlayer "C:\Windows\Media\notify.wav").PlaySync();');

    but that's at least windows OS specific, but actually worked on my machine

  3. This depends on the image format an what exactly "resizing" means in this way. When you use the compression feature of PNG the dimensions of that image (width, height, color depth) stay the same and that process is perfectly reversible as PNG is a lossless format, the codec just tries to put as much information as possible into as less bytes as needed, this may result in higher CPU usage. Using JPEG compression you destroy image details and it's irreversible. If you change any dimension or cut something off of your image that information is lost, no matter what format you use. But for the exact details i recommend reading the specification of the image codec.

     

  4. replace print_r with var_dump to see what the variables actually contain. Check every condition if it really matches your expected values, like var_dump($residue) and so on. As this is a recursive function it may be of interest to have a static iteration number and all given function arguments to display. As this is a working example (good!) you can test this first online to see if may be a configuration issue on your machine

    https://3v4l.org/VC646

  5. Looks like you just have to skip some parts

    var_dump(new DateTime('Sun, Feb 9 3:00 PM'));
    
    /**
    
    object(DateTime)#1 (3) {
      ["date"]=>
      string(26) "2020-02-09 15:00:00.000000"
      ["timezone_type"]=>
      int(3)
      ["timezone"]=>
      string(16) "Europe/Amsterdam"
    }

    then modify() and format().

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.