| Forum Home | ||||
| Press F1 | ||||
| Thread ID: 128591 | 2013-01-01 01:26:00 | PHP Array getting the first 2 chars | Morgenmuffel (187) | Press F1 |
| Post ID | Timestamp | Content | User | ||
| 1320936 | 2013-01-01 01:26:00 | okay this function $md5 = md5($data); $file = $snot['cachedir'] . '/' . $md5{0} . '/' . $md5 . $ext; specifically the bit in bold, I want to get the first 2 characters, currently I am only getting the first character, I know its do-able as I have done it before, but for the life of me I keep stuffing up, its like nailing jelly to the wall everytime I think I've got it it slides away |
Morgenmuffel (187) | ||
| 1320937 | 2013-01-01 01:47:00 | Tried the substr function? php.net | pcuser42 (130) | ||
| 1320938 | 2013-01-01 20:23:00 | Cheers, thats the one, its really quite embarrassing when you cant remember a function at all | Morgenmuffel (187) | ||
| 1 | |||||