I have a problem with the explode () function. I use this function to blow strings like "Name: Replica", but sometimes there are 2 or more colons (":") in the string, and there is a problem because my script: Example: " Name: replica: replica2: replica3 "
$explode = explode(":", $string);
$query = "INSERT INTO `table` (`field_1`, `field_2`) VALUES ('".$explode[0]."', '".$explode[1]."')";
And I need a solution to this problem. Because when I split the line after the first colon (":"), the second part should be the last part.
Regards, George!
Ps - Sorry for my English.
user546774
source
share