PHP code example of automattic / tracks-shared-utils

1. Go to this page and download the library: Download automattic/tracks-shared-utils library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

automattic / tracks-shared-utils example snippets


use function Automattic\TracksSharedUtils\sanitize_url;
use function Automattic\TracksSharedUtils\url_props;

foreach ( url_props() as $prop ) {
	if ( isset( $props[ $prop ] ) && is_string( $props[ $prop ] ) ) {
		$props[ $prop ] = sanitize_url( $props[ $prop ] );
	}
}