0

i need to trim a student id

below is my php code


<?php
$stud_id ='MCC-2011-2012-0001'
//what is the code to remove the MCC-2011-2012- so that i can retrieve the 0001
//or code to remove the first 14 characters
echo $stud_id;
?>

//thanks a lot...:)

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by lloydsbackyard
0

You shouldn't be asking people to write your code for you, it appears you're doing this for school or some other project.

However, to direct you in the right direction, have a look at the PHP 'explode()' function.

http://www.php.net/manual/en/function.explode.php

There are some examples on that page that should show you what you need to do.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.