
Dragosvr92
Members-
Posts
276 -
Joined
-
Last visited
Everything posted by Dragosvr92
-
Sorry but i havent understood your question right. $YearArr = array( 1 => '19', 2 => '19', 3 => '18', 4 => '18', 5 => '20', 6 => '20' ); I have the array above. The keys 1 and 2 must output 19, if selected. I want to remove the duplicates. I think it is easy to understand.
-
I just want to remove the duplicates. Number 1 or 2 means/echoes 19. Same for the others. Thanks for the fast answer !
-
I have this array which has double contents. $YearArr = array( 1 => '19', 2 => '19', 3 => '18', 4 => '18', 5 => '20', 6 => '20' ); Would it be possible to remove the repeating data, and make it look like something like this? $YearArr = array( 1/2 => '19', 3/4 => '18', 5/6 => '20' ); Thanks
-
That looks pretty awesome Samuz ! Nice to see a full HTML5 website. I would fix this silly error if i were you.. Line 20, Column 34: The align attribute on the h1 element is obsolete. Use CSS instead. <h1 class="title2" align="center">Jerri Hart</h1>
-
Yes, it is solved. I wasnt used with the new forum software, and havent noticed the solved button.
-
Because that number is in an Romanian Social Security Number format, and i wanted to extract all the data out of it, for personal use. I finished the script when i got the Age script from the previous topic i posted in.
-
Thank You salathe ! I managed to make my script display the full year (Y, not y), and the script works better.
-
I have a script that outputs the birthyear in the dd.mm.yy format. Example 15.02.92. Does anyone have a clue how may i calculate the age against the current, autogenerated date? I just want the straight age. Not the Day/month. But i wouldnt mind if it does both. Thanks in advance. PS: This is the second topic i create on this new forums. Does it still use SMF? The "Textarea" which seems to be an iframe, and not a textarea is annoying me. I dont have the copy/paste menu when i right click in it. The undo option is also a bit screwy.
-
Because that long number means something, and i need to extract the data in it. Thank you spfoonnewb.
-
I dont understand.... So i have this array : Array ( [1] => 1 [2] => 23 [3] => 45 [4] => 67 [5] => 89 [6] => 002 [7] => 4 ) I need to make an array for each index, and output the matching data. If [1] outputs 1, then it should replace 1 with male, and 2 with female. I would prefer to do this from an array of : Array( [1] => Male [2] => Female ) Something like: <?php $gender = $match[1]; if($gender == "1"){echo"Male";}else{echo"Female";} ?> Do i make any sense?
-
Thank you both. I will go for the cleaner version's preg match, and use the shorter if statement. Is there any documentation of the preg_match things used to split something? I dont know how they work at all. Also, do you know how may i replace $match[5] aka 89 with a word that is found inside another array of words? The word inside the array would have the number 89. Should i use an if statement, or some str/preg_replace ....?
-
I am looking into splitting a number of this format "1234567890024" in an array that would look like this: Array ( [0] => 1 [1] => 23 [2] => 45 [3] => 67 [4] => 89 [5] => 002 [6] => 4 ) I had a look at str_split, but it doesnt seem to allow you to split a number in different numbers..
-
Thank You very much Dan. Sorry for my late reply.
-
And i need to output the date using mktime() to output the timestamp. the timestamp is what i need, not the date.
-
With c it outputs 2008-03-03T20:26:00+00:00 With A it outputs PM/AM This is my Code: <? if (isset($_POST['DATE'])) { $str = $_POST['DATE']; $chars = preg_split('/[-:, ]+/', $str); $timestamp = mktime($chars[3], $chars[4], '00', $chars[0], $chars[1], $chars[2]); echo date('m-d-Y, h:i A', $timestamp); echo '<br />', '<br />'; echo $timestamp; } ?> I just need to make an array and replace for example 08 with 20, so that the time may be set as PM. I think you are getting confused :-\
-
Thanks Dan, but that doesnt look like what i need. I Made the script myself, but i have a problem on detecting if its either morning or night, using mktime(). For example there may be 03-05-2008, 02:17 AM, and 03-05-2008, 02:17 PM. A solution i thought about would be to make some if statement and check if PM is selected, and if it is, check an array and if it finds, for example: " 03 " it replaces it with " 15 ". here is some lame script i made..... $chars[5] outputs PM/AM $chars[3] outputs the hour <?//AM if ($chars[5]=='AM' || $chars[3]) { array{ "01" = "13"; "02" = "14"; "03" = "15"; "04" = "16"; "05" = "17"; "06" = "18"; "07" = "19"; "08" = "20"; "09" = "21"; "10" = "22"; "11" = "23"; "12" = "00"; } } ?> Can you please give me a example?
-
It took me a few hours to figure it out, and make it, after i last posted,but i have done it using preg_split() as i needed to split it by the 3 symbols => - , :
-
Thank you, i will look at that tomorrow. I didnt thought on using explode() I remembered why i had to use a input for each area and didnt made it like this
-
Well that was very helpful..
-
Yes.
-
Hello, i need a fast convertor that converts the date format 03-03-2008, 08:26 PM into a timestamp fast. Like, you paste 03-03-2008, 08:26 PM into a post form, submit and it gives you the time stamp. I made a convertor a whille ago, but you need to insert each numbers into a separate input box (day, months, year etc) I cant remember how exactly it functions etc asi haventtouched PHP In a while.....
-
PHP Gets parsed/generated inside the server, then outputs HTML, CSS, Javascipt etc.. Whever it is set to do. After the PHP functions/strings/whatever gets read/interpreted by the server, it outputs what you proggramed it to do. That is why its said its Server side scripting, same as Apache etc.
-
Figured it out myself.
-
Hello, yesterday i have added Google search on my site, and i am having a little trouble with placing the imput form. This is the page with the issue is And this is how i'd lke it to look like: I have no idea why the form element wouldnt stay on the same line, as both things (google ads and form) are on the same td element. Could anyone please have a look and see how may i get it to look right? Thanks in advance.
-
hi thorpe, i meant what kicken said. kicken, you are right. there are databases, but they arent free, i thought a php functioon may be able to do that. nevermind.