csckid Posted July 19, 2010 Share Posted July 19, 2010 isn't there any data type called byte in php? Link to comment https://forums.phpfreaks.com/topic/208185-byte/ Share on other sites More sharing options...
gwolgamott Posted July 19, 2010 Share Posted July 19, 2010 PHP has only 8 official primitive types. http://us.php.net/manual/en/language.types.intro.php Trying to conserve space with a byte? what are you trying to achieve? Link to comment https://forums.phpfreaks.com/topic/208185-byte/#findComment-1088163 Share on other sites More sharing options...
csckid Posted July 19, 2010 Author Share Posted July 19, 2010 I'm trying to convert string into image or byte to image; anyone would work. When I print byte as string it outputs "[b@d590dbc". I have no idea what sort of encoding is applied to it. And when I print ByteArrayOutputStream as string it outputs ‰PNG iiCCPPhotoshop ICC profile¡»Dw¿n§î˜ž¾^€žLo§Þy½çú}@q¤øSâ(RÊjJåå4åe˜2AU£šRݨ¡T............ Can this peculiar string be converted into image? Link to comment https://forums.phpfreaks.com/topic/208185-byte/#findComment-1088169 Share on other sites More sharing options...
gwolgamott Posted July 19, 2010 Share Posted July 19, 2010 there is an imagestring function for creating a string on an image... not sure if that's what you are looking for. Link to comment https://forums.phpfreaks.com/topic/208185-byte/#findComment-1088255 Share on other sites More sharing options...
csckid Posted July 20, 2010 Author Share Posted July 20, 2010 there is an imagestring function for creating a string on an image. I should be able to convert string into any file. like mp3 Link to comment https://forums.phpfreaks.com/topic/208185-byte/#findComment-1088617 Share on other sites More sharing options...
AbraCadaver Posted July 20, 2010 Share Posted July 20, 2010 there is an imagestring function for creating a string on an image. I should be able to convert string into any file. like mp3 What do you mean "convert"? Do you want to save this string as a file? If so, have you tried: file_put_contents('/path/to/save/file.png', $string); Link to comment https://forums.phpfreaks.com/topic/208185-byte/#findComment-1088704 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.