Tags: php

difference between two arrays

Tags:


I have following two arrays. I want the difference between these two arrays. That is, how can I find the values that do not exist in both arrays? $array1=Array ( [0] => 64 [1] => 98 [2] => …

Tags:

Multibyte trim in PHP?


Apparently there’s no mb_trim in the mb_* family, so I’m trying to implement one for my own. I recently found this regex in a comment in php.net: /(^s+)|(s+$)/u So, I’d implement it in the …

Tags:

Running code in Javascript to make a PHP and HTML file run from an ONLOAD event


As a newbie I am trying to run a PHP file and then an HTML file automatically using an onload=”Trigger();” in the body of the HTML. Enclosed is my code but it will not work even though the onload is …

Tags:

What does “XDEBUG NOT LOADED AS ZEND EXTENSION” warning means?


Xdebug is loaded, but not loaded as a zend extension. What does it mean? How to resolve this problem?

Tags:

Converting a UNIX Timestamp to Formatted Date String


Using PHP, I want to convert UNIX timestamps to date strings similar to this: 2008-07-17T09:24:17Z How do I convert a timestamp such as 1333699439 to 2008-07-17T09:24:17Z?

PHP recursive array copy

Tags: , , ,


I have a multidimensional array of arrays (source below), where my keys and values are arbitrary strings. I want to create a new array (desired below), where the hierarchy stays the same, but every …

Tags:

explode string into variables


Is there a way to explode a string into variables e.g some_function($min, $max, “3, 20”); such that $min is assigned the value 3 and $max is assigned the value 20. I know I can simply use $data = …

Tags:

Inline PHP (command line)


I would like to make something like tryruby.org. I take a line from the user (e.g., echo __FILE__) and I want to execute it in PHP and return the output back to the client. I tried to do exec(‘php -r ‘…

Tags: exception php

PHP “Exception not found”

Tags: ,


I have a somehow funny issue. While trying to understand why a certain website returns http code 500 to browser, I found the message PHP Fatal error: Class ‘MZ\MailChimpBundle\Services\Exception’ …

Tags: php

PHP Get name of current directory

Tags:


I have a php page inside a folder on my website. I need to add the name of the current directory into a variable for example: $myVar = current_directory_name; Is this possible?