php - how to explode a string and make an echo of a chosen attribute -
php - how to explode a string and make an echo of a chosen attribute -
i have string containing ; subdivided , , create echo of chosen value.
my string $string='width,10;height,5;size,1,2,3'
i want create echo of height value (echo result must 5)
$parts = explode(';', $string); $component = explode(',', $parts[1]); // [1] height,5 portion echo $component[1]; // 5
php
Comments
Post a Comment