php: Sort a multidimensional array by value
2020-01-18

PHP,array,EN

say you want to sort the following array by the value of mainType.

array $aData

$aData = array(
    0 => array(
        'name' => 'abc',
        'size' => 7000,
        'type' => 'image/png',
        'mainType' => 'image',
    ),
    1 => array(
        'name' => 'document',
        'size' => 25000,
        'type' => 'application/pdf',
        'mainType' => 'application',
    )
);

sort method
using php's usort command here will do the job.


 […]

Parsedown: image size dimension attribute
2020-01-01

markdown,parsedown,PHP,EN

This class BParsedown as an extension for "Parsedown" reads optional image size dimensions like =50x50 in markdown syntax and builds a proper image tag with width and height attributes from it. It supports inline syntax as well as markdown per reference.

Tested with Parsedown Release: 1.7.4.

Examples

Inline

markdown


![Odyssey2001.png](http://example.com/Odyssey2001.png =100 […]

This website uses Cookies to provide you with the best possible service. Please see our Privacy Policy for more information. Click the check box below to accept cookies. Then confirm with a click on "Save".