Hello. Can you please tell me how to check the first character in a variable? we have: $ number = 8-950-xxxxxxxx;

you need to create a condition, if the first character is 8, then we change it to 7. We do not touch the remaining 8 in the room .. Thank you.

    1 answer 1

    if($number[0] == '8') { $number[0] = '7'; } 
    • thank you very much. turnips yet. - najort
    • @najort is not in the reputation of the case :-) I am much nicer to know that everything turned out. - lampa
    • but this is a very, very strange question)) - thunder