Cheap and good way to feed 12v digital input

Will this work too..??
http://in.element14.com/on-semiconductor/mmun2215lt1g/transistor-digital-sot-23/dp/9556680?whydiditmatch=rel_3&matchedProduct=dtc114&matchedProduct=dtc114&whydiditmatch=rel_3

Yes, this type will also work.

Note that the transistor begins to turn at about VBE = 0.5V.
The MUN2215 will turn on when the input is at 0.5V.
The DTC114W will turn on when the input is at 1.5V, providing higher noise immunity.