2
I need to go through this array and get all the keys that start with col. Does anyone know how to do this?
array:8 [▼
"_token" => "NZ68b8h3L560aUc6DXBeb8Myb4JFD0hSgfSpJ2Lk"
"_method" => "PUT"
"col1-22" => "22"
"col1-26" => "26"
"col2-23" => "23"
"col2-24" => "24"
"col3-24" => "24"
"col3-25" => "25"
]
You would like to make the explode with which delimiter?
– adventistaam
Could you ask the question? I can’t paste.
– Maury Developer
the delimiter is the hyphen "-".
– Stenio Francis
What is the purpose of
explode()
?– rray
Why explode the value in the hyphen if the value related to that key is already the desired value? For example, you do not need to
explode("-", "col1-22")
to get the 22 if just access the position"col1-22"
of array.– Woss
@Steniofrancis looks at logic
col1-22" => "22"
 "col1-26" => "26"
 "col2-23" => "23"
 "col2-24" => "24"
 "col3-24" => "24"
 "col3-25" => "25"
They all look alikecol
.– Maury Developer
yes, let’s forget the explode, as I go through the array and get the keys from the col?
– Stenio Francis
@Steniofrancia you want key name or cols value?
– Maury Developer