Zend - The PHP Company




Code Gallery: phpfarm


full "text on image" function. Center and wrap text.  

Type: code fragment
Added by: phpfarm
Entered: 24/05/2001
Last modified: 05/12/2000
Rating: - (fewer than 3 votes)
Views: 9031
ok, well as you may have noticed, imagepstext, and imagettftext do not word wrap. I ended up writing THIS code to combat that, and also to help in ALL my sites. With very little work it can be changed to do lots of cool things with text. This SHOULD work, i dont THINK it is an older copy...


Traversing a tree  

Type: code fragment
Added by: phpfarm
Entered: 24/05/2001
Last modified: 05/12/2000
Rating: *** (3 votes)
Views: 11404
I needed a way of organizing information in a mySQL db. I decided that I would have a column called "parent" which would have in it the ID number of the "parent" of this entry. Meaning that if the ID of "table" were 1, then the parent of "leg" would be set to 1. At the time I did not know it, but this is called a tree. Now I needed to be able to fetch the information OUT of the database. I wanted it to show in a select box, parent[indent]child etc....

so, with MUCH help of Michal Baumann of Maryland/Florida, I (she) wrote this (be sure to change it around as much as your heart/program desires/needs):





Search