here is my problem - in my searchform i want to check for occurances of patterns with dot (.) or commas (,) inbetween letters or numbers where it's no space around them - and include the same pattern to the string only with exchanged comma or dot.
3x2.5 == true
2x1,5 == true
You 2, whatever == false (note the space)
hello. How are you == false (also a space)
Ive managed to get this far:
preg_match_all("/([A-Z0-9]+[,][A-Z0-9])/i", $text, $array) // or preg_match_all("/([A-Z0-9]+[.][A-Z0-9])/i", $text, $array)This however produces array and array with the same values.
Target is this:
$string = "cable 2x2,5 cu"; // where 2x2,5 is true
$new_string = "cable 2x2,5 cu 2x2.5";
$string = "cable 7x1.0 cu"; // where 7x1.0 is true
$new_string = "cable 7x1.0 cu 7x1,0";
Any help on this ?