Skip to content
Advertisement

Seperate integer into character PHP

i try to make scoresheet where $row[“first”]=756987 show Math 7, Biology 5, Sport 6, Sociology 9, Chemist 8, English 7 but it keep showing all 7
can someone help solve this and show some example
appreciate your help

Advertisement

Answer

Use str_split() and list() method for your use case, example below:

Docs

list() : https://www.php.net/manual/en/function.list.php

str_split() : https://www.php.net/manual/en/function.str-split

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement