ferret147 Posted March 9, 2009 Share Posted March 9, 2009 I am getting the contents of a .txt file, then I want to use the contents to change things on my page; here is an example. Contents of .txt file is - 023000023200500814050317310903091 The data is broken up like this - 023 000 023 2 005 008 14 0503 1731 090309 1 Lets say I have a H1 tag and I want that to be the first 3 digits, then I have a image but I want Image one to display if the 10th digit is 1 and Image two to display if the digit is 2. Got any ideas how I would achieve this? Link to comment https://forums.phpfreaks.com/topic/148639-solved-seperate-numbers/ Share on other sites More sharing options...
jcombs_31 Posted March 9, 2009 Share Posted March 9, 2009 Can't you just use substr for that? http://us3.php.net/substr Link to comment https://forums.phpfreaks.com/topic/148639-solved-seperate-numbers/#findComment-780539 Share on other sites More sharing options...
ferret147 Posted March 9, 2009 Author Share Posted March 9, 2009 I will give it a bash and see what I come up with. Thanks Link to comment https://forums.phpfreaks.com/topic/148639-solved-seperate-numbers/#findComment-780543 Share on other sites More sharing options...
Mchl Posted March 9, 2009 Share Posted March 9, 2009 Or fread with second argument being the number of digits to read from file? Link to comment https://forums.phpfreaks.com/topic/148639-solved-seperate-numbers/#findComment-780546 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.