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

java - How to pass parameters between Request-Scoped Controllers? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -