[go: up one dir, main page]

0% found this document useful (0 votes)
14 views1 page

Sudent Numbers Generator

The document contains a PHP function that generates a unique student number based on the current year and the count of students registered in that year. The student number format is 'RYYYYXXA', where YYYY is the year, XX is the incremented count padded to two digits, and A is a constant suffix. The function is called during the registration of a new student to produce their unique identifier.

Uploaded by

godknows dembure
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

Sudent Numbers Generator

The document contains a PHP function that generates a unique student number based on the current year and the count of students registered in that year. The student number format is 'RYYYYXXA', where YYYY is the year, XX is the incremented count padded to two digits, and A is a constant suffix. The function is called during the registration of a new student to produce their unique identifier.

Uploaded by

godknows dembure
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

function generateStudentNumber($year) {

$count = // Query to get count of students registered in the current year.

$count += 1; // Increment by 1 for the new student

$studentNumber = "R" . $year . str_pad($count, 2, '0', STR_PAD_LEFT) .


'A'; // Example: R202301A

return $studentNumber;

// When registering a new student

$studentNumber = generateStudentNumber(date('Y'));

You might also like