$plugin) { $plugin_base = basename( $plugin_slug, // Get the key which holds the folder/file name '.php' // Strip away the .php part ); $syncho[$plugin['Name']]['title'] = $plugin['Name']; $syncho[$plugin['Name']]['version'] = $plugin['Version']; $syncho[$plugin['Name']]['infos'] = $plugin_base . '|' . $plugin['PluginURI'] . '|' . $plugin['Description']; } $encode_json = json_encode($syncho); echo $encode_json; } }