please convert this vb function to php function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
habibo370
Forum Newbie
Posts: 3
Joined: Thu Dec 12, 2013 7:27 am

please convert this vb function to php function

Post by habibo370 »

Public Function DecToHexStr(ByVal inVal As Integer) As String
Dim s As String
s = Trim(Hex(inVal))
If Len(s) < 2 Then
s = "0" & s
End If
DecToHexStr = s
End Function
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: please convert this vb function to php function

Post by requinix »

CoursesWeb
Forum Newbie
Posts: 18
Joined: Mon Dec 09, 2013 10:52 am

please convert this vb function to php function

Post by CoursesWeb »

Hi
Not know VB, but according to the function name: DecToHexStr, if it converts decimal number to hexadecimal string, in php you can use the dechex() function: http://www.php.net/manual/en/function.dechex.php
habibo370
Forum Newbie
Posts: 3
Joined: Thu Dec 12, 2013 7:27 am

Re: please convert this vb function to php function

Post by habibo370 »

thanks dechex work!!!
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: please convert this vb function to php function

Post by Eric! »

I can't see "visual basic" without being reminded of the classic use tracing of IP with it. Warning, you can't un-see this.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: please convert this vb function to php function

Post by requinix »

Eric! wrote:I can't see "visual basic" without being reminded of the classic use tracing of IP with it. Warning, you can't un-see this.
Lemme guess: CSI NY and the gooey? Yeah, I really wanted to remember that... :banghead:
Post Reply