Ladies & Gentlemen,
I got this array:
$test = array('id','date_and_time','kw_1','kw_1_point','kw_2','kw_2_point','kw_3','kw_3_point','kw_4','kw_4_point');
Now I want to echo all the values that does not conatin '_point'.
So, how to do that ?
Ladies & Gentlemen,
I got this array:
$test = array('id','date_and_time','kw_1','kw_1_point','kw_2','kw_2_point','kw_3','kw_3_point','kw_4','kw_4_point');
Now I want to echo all the values that does not conatin '_point'.
So, how to do that ?
@pritaes
Thanks.
But what if I want to search for string that starts with "kw" ?
Or has "" somewhere ?
And what-about if I want to search for string that has "1" in midst somewhere ?
How does this work for you?
foreach($test as $v){
if (strpos($v, '_point') !== false) {
echo $v;
}
}
I didn't test it
He wants all the values that don't contain point, so it would be the opposite:
foreach($test as $v){
if (strpos($v, '_point') === false) {
echo $v;
}
}
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.