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

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -