02.10.2015, 16:59
Hello, I have a string like
"Hello||Sup||Nothing, wbu?||Just chilling", and I want to use the || as a delimiter, and loop through each to
The amount of messages is fluctuating. I haven't scripted on SA-MP for several years, so I am extremely rusty. Something like PHP's explode function.
In PHP, it's
which outputs
Any help would be appreciated, thanks.
"Hello||Sup||Nothing, wbu?||Just chilling", and I want to use the || as a delimiter, and loop through each to
Код:
SendClientMessageToAll(-1, "Hello"); SendClientMessageToAll(-1, "Sup"); SendClientMessageToAll(-1, "Nothing, wbu?"); etc..
In PHP, it's
Код:
<?php
$string = "Hello||Sup||Nothing, wbu?||Just chilling";
$messages = explode("||", $string);
foreach($messages as $message)
{
echo $message . "<br>";
}
?>
Код:
Hello Sup Nothing, wbu? Just chilling

