I want to cut text after find ","
input text > 12223443,3532432
I want > 12223443
**text length is no fixed
I want to cut text after find ","
input text > 12223443,3532432
I want > 12223443
**text length is no fixed
You can try with explode() function :
<?php
$parts = explode(',', "12223443,3532432");
echo $parts[0];
Or as @JustOnUnderMillions said with substr() and strpos() functions :
<?php
echo substr("12223443,3532432", 0, strpos("12223443,3532432", ','));
Or even with strstr and PHP 5.3+ (@sidyll and @JustOnUnderMillions) :
<?php
echo strstr("12223443,3532432", ',', true);