Does anybody know an addon or a solution to do something like this:
{if variable_a within variable_b}Do Stuff{/if}With “within” I mean variable_a is contained in variable_b. Like here:
variable_a = “lam” variable_b = “slamming”
or
variable_a = “34” variable_b = “5&39;&34;$7&23;&66;”
Note: I have absolutely no clue of PHP :-(
I’d appreciate your help very much 😊
Hi DocDiversity,
My PHP isn’t fantastic but I believe this should get you what you need here using PHP :
<?php
$variable_a = "5&39;&34;$7&23;&66;";
$variable_b = "34";
if(stristr($variable_a, $variable_b) === FALSE) {
echo 'NOT FOUND!!';
} else {
echo "FOUND!!";
}
?>There may well be a better way of doing this though and hopefully if there is someone will pipe up and let us both know 😉
Hope that helps a bit though.
Best wishes,
Mark
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.