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

ios - Fragment Shader GLSL for texture, color and texture/color -

iphone - Dismissing a UIAlertView -

java - Does anyone know the name of this "LookAndFeel"? -