Convert From 4-digit To 2-digit Year
I am trying to convert from a 4-digit to a 2-digit year. Here is my code:
$date = "2007-10-02";
$explode_date = explode("-", $date);
echo $new_date = $explode_date[1].$explode_date[2].$explode_date[0];
The result is 10022007 but I need it to be 100207(mmddyy).
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Finding Last Digit In 2+ Digit Number
Is there a way in PHP to take a two or greater digit number and find the value of the last digit. For example, if the number given is 3718, is there a PHP function to find out that the last digit is an eight?
How To Compare The First Digit Of A Number?
if($row[PurchaseNo]==$_post[firstprize]{}; the $row[PurchaseNo] is one digit , while $_post[firstprize] is four digit how to compare $row[PurchaseNo] with the FIRST digit of $_post[firstprize] ?
Adding A Single Digit To A Previous One.
Basically what i need to do is get the last entry from table "job_part" WHERE quote_id=$quoteid It will pull a digit, if there was one in the database. I would then like to have text field that is given the value that we just got from the database, and add 1 to it. so if it pulled a "1" it would " + 1" and set the value of the text box to "2" quite simple probably. I just need to have someone show me how it is done. I need to present this to my client today and this is the final step to have it working!. Heres the code for the page. Code:
Function To Find 6 Digit Numeric String
I need to parse a string and attempt to find a substring in the string that contains 6 numeric digits. the first and last digit may or may not be preceded by a space. I need to find the starting the ending positions of the 6 numeric digits to that I can extract the string and build an href containing the string and replace those 6 digits with a hyperlink.
Check Week Number In End Of Year And Begiining Of New Year?
I am creating a little own calendar. Now I want to add a "previous week" and "next week" functionality to the calendar. It is easy to take $thisWeek - 1; and $thisWeek + 1;, but there has to be a check wether it is the last week of the year and it should actually be a new year and head to week number 1. HOW do I make this kind of function? I use the following string names: $thisYear $thisWeek
Starting A Year Loop With Last Year
I have the following which loops through the present year and adds two more years on: However, I want it to be exactly the same but to start from last year rather than this year. Is this possible? Code:
Week Of Year
Is there a function which returns the week of the year, given a specific date?
Day Of Year Count
I have a script that reports that day on which a post expires as: 2000-06-12. What i would like to do is post it instead as: Expires in: 11 Days. So basically, I'm looking for a PHP3 way to do a Day of year Subtraction. I know with MySQL its: (TO_DAYS(Expires) - TO_DAYS(Current_Date)) is there a way to do it without going back into MySQL, using PHP3? OR how to i configure my Select so that it will automatically output "Expires" date as a the day count UNTIL expires.
Last Day Of Year Date Bug?
Guys, the line below just returned "Dec 07" as the date for one month back from today. Hardly life-threatening, but any thoughts? <?php print date("M `y", mktime(0, 0, 0, date("m")-1, date("d"), date("Y")));?> AS...
Need Date For Every Monday Of Year
Is there a way to get the date for every Monday for a particular year and have it populate a drop-down box? Need something to start by.
Calendar Displaying A Whole Year?
I'm reasonably new to php and have been looking everywhere for tutorials on creating calendars. I've found so many, but they're all relatively the same, where they only display one month at a time. If anyone could point me in the direction off a tutorial where I can create a calendar to display a whole year in one go, instead of one month that would be absolutely great. I'd quite like a tutorial instead of a simple download, because I can learn more by going through it all. I don't need any fancy stuff like events. It's litterally just a calandar with nothing on it but the dates.
Date() With Leap Year
I am using this function below in a script to create a count down script. <? date(("z"), time() - (14400 * 1)) ?> My question is; does the "z" (0 - 365) go up to a maxium of 366 when it is leap year?
Dynamicaly Display Month And Year
Hi how can i display month and years dynamically without using database in a drop down menu. <select name=month> <option value=1>January</option> <option value=2>February</option> ... </select> Also the year drop down since 2003 value will be added with every year ie in 2004 it shd show: <select name=year> <option value=2003>2003</option> <option value=2004>2004</option> </select> and so on.. Any help?
Selecting Year & Month From Timestamp(14)
What I'm trying to do is create a link to a page that displays the headings of articles from a previous month of the year. The link will be something like <a href="/prevnews.php?yearmonth=$var"> and then on the page I will query the database with a line like: SELECT * FROM table WHERE TimeEntered=$var My problem is, I don't know how to select all columns from a table where the year and month are whatever I specified in $var. My TimeEntered column is timestamp(14), so YYYYMMDDHHMMSS. If I could just get the YYYYMM part, that would be fine. How do you do that? Also, I run this query on the page. Could I somehow use the variable fDate to get the YYYYMM ? PHP Code:
Can't Get Month Year From Variable Using Date()
I have a very simple question about date(). I am using date('l, F d, Y'); to show Tuesday, August 22, 2006. But now when I am trying to display just Month - Year i.e (August - 2006) from variable, Its not coming through and displaying January - 1970. Code: I have done date("F - Y", $entry_date) for this. Can any one just point me out or suggest where I am wrong here?
Exclusive REQ: PHP Developer In Sunnyvale, CA - 1 Year
We have an exclusive requirement for PHP Developer in Sunnyvale, CA. I can get the interview with in 1 hour and PO by end of the day. There is no client interview for this position. Please forward updated resumes with contact info, expecting rate ASAP. Interview in 1 hour, PO by end of the day Location: Sunnyvale, CA Duration: 12 Months Start: Tomorrow No of needs: 5 Rate: $Open/Hr Client: Yahoo Required Skills: ·3+ years of PHP Development experience ·UNIX or LINUX, My SQL, Apache, Java Script ·HTML, DHTML, CCS ·Web Applications experience is a plus ·Candidates, who have worked with search engines like Google, Yahoo will be of great help, though it is not mandatory ·Should have excellent communication skills
Printing Full Year Calendar?
I use a calendar script, Keith Deven's PHP Calendar. I've modified it to incorporate events into it and everything works great. The problem I'm having trouble with is when I print the year long calendar. For some reason it only reads the dates in the database for the current month, in this case March and it outputs the same days for every single month. Code:
Search Data Between Two Specific Year?
I have tabel called "candidate" in that i have two fields call Graduation Passing year and Post Graduation Passing year. In that table i have more than thousands number of candidate. Here i want to make a search php form. Where i can get data of specific candidate who pass between specific year. I have make a form for search with below fields: Graduation Candidate search : Year From and Year To fields and submit button to call query form and display result. Code:
Date/Time Column, Accessing Only Year
I'm trying to generate a table that gives some statistics. I've got a date time column that registers hits. I need to calculate the number of hits for 2006 using the 'date' column, which is the date time column.
Select Distinct Year From Unix Timestamp
I'm trying to select all distinct years from a unixtimestamp field in MySQL database. I have a query: SELECT DISTINCT YEAR(date_field) As theYear FROM table but it gives me an empty array. What am I doing wrong?
List Weeks Of Year Using Calendar Function
I've been asked to design a small site which contains a page with a list of dates to show a visitor if accommodation (running from Saturday - Friday) is booked or available. Something like this: 2007 2nd Jan - 8th Jan - Available 9th Jan - 15th Jan - Available 16th Jan - 22nd Jan - Booked 23rd Jan - 29th Jan - Available 5th Feb - 11th Feb - Available 12th Feb - 17th Feb - Available etc, etc I'd like to dynamically create the list of dates using the php calendar functions and a mysql database so that each row (52 in total?) could be flagged 'booked' or 'available' allowing easy updating using a back end form. Ideally the page showing the list would have a link taking the visitor to another page showing the following year's dates. Each list would always show a year to view and always run from Jan to Dec.
How To Convert Asp To Php
I have a database system coded in asp using dreamweaver mx. Can I convert the code to php by using dreamweaver mx ? If can, please tell me how. Currently I'm using PWS on Windows ME with MySQL as a database.
How To Convert BMP To Jpg?
I need help for convert bmp image to jpg file. So anyone can help me to convert bmp image to jpg image by php's GD library or any ways by php. Please help me as soon as possible. Or you can help me how to resized bmp file in different dimession other then its actual. I need image resize functionality for resize it on the while someone upload image. So Please help me as soon as possible. Coz I am stuck over here in my last stage project.
ASP Convert To PHP
I have to convert a program currently built in ASP to work under PHP. The following code is an ASP function. Using PHP could somone show me how to build basically the same function in PHP. Basically I understand I will need a class and objects, but my knowledge of the class and objects is limited, I think if I could see this in a php format I would be able to finish the rest of the project on my own. PHP Code:
Convert PHP To CGI?
I am learning PHP and will make my scripts with PHP but my webserver does not support PHP but instead supports CGI. Is there a way to convert a PHP script to CGI without having to know both languages?
Pls Convert
<SCRIPT LANGUAGE="JavaScript"> <!-- Begin function Login(){ var done=0; var username=document.login.username.value; username=username.toLowerCase(); var password=document.login.password.value; password=password.toLowerCase(); if (username=="edna" && password=="guytoi") {window.location="viewfood.html"; done==1; } if (username=="tony" && password=="food") { window.location="editfood.html"; done=1; } if (username=="arlene" && password=="manitoulin") { window.location="viewfood.html"; done=1; } if (done==0) { window.location="failed.html"; } } // End --> </SCRIPT> ----------------------------------------------------------------------- Pls tell me how or if i need to convert the above to php. Eventually i would like to open a file with the usernames/passwords--put data in an array(s) then valadate them but thats down the road.
Convert Hh:mm PM To Hh:mm:ss
Does anyone know of a function or code that will convert hh:mm PM to hh:mm:ss? I tried the following but it does not work... $date = "2007-05-08" $time = "01:30 PM" $datetime = date("y:m:d h:i:s", strtotime($date . " " . $time) This yelds $datetime = "2007-05-08 01:30:00" which the database interprets as 1:30 AM
Convert Smiles
Hello, I'm working on a forum script and I came across something weird. While working on a func to convert text smilies to images i found that some funcs did this with alot of code while i was able to do it with alittle, hence i've come to the conclusion that my way is probably wrong. Let me know what you all think and if this function should work.
Convert .php Into .html
I have a pre-made php class that converts html into pdf documents. It can also convert php pages into pdf but it converts it before the php page executes. So in the resulting pdf you get all the php code. I was wondering is there a way i can let the php page execute and then let the pdf class convert it? I know it will be hard to say that without looking at the php class. I was thinking would there be a way to execute the the php page, and have it made into an html page? So this way i can run the php class on the html page.
ö Convert To ö
i want convert special character like ö,ä,ü or é, ã or ê to a "special" character. this character are from a textfield from the user. i want to safe it in a db, and i want that these character are shown exacly the same indepence if on a mac, windows or in america or europe.
Convert PDF To HTML
I found loads of scripts to convert html and other formats to PDF but is there an easy way to do it vice versa?
Convert Html To Pdf
I'm too new in php. my boss wants me to convert a html page to pdf form. anyone (here) can give me a tips how to do that?
Convert Date Into Day
I posted a question about session variables and appended variable value to a url and I figured it. Thanks for those who helped. Now, I have question about converting date into actual name of day. For example, converting 2005-05-12 to thursday. Is there a way to do that?
Convert PHP/HTML To PDF
I need to convert PHP page or HTML page to PDF . Google , and found some tools as follow , 1) HTML_toPDF -- i have tried to use , however for our client website , the PDF aligment is out and the fields are overlapping each other. 2) R&OS --- ok but did not convert html/php to pdf , thus the format in pdf is different as the html/php format which our clients did not like it. Anyone have any ideas about different pdf tools? Have some sample code is much appreaciated.
Upload 3gp, Mov, Avi, Etc And Convert To Flv
I'm working on a project with my own server (xampp 1.54a with apache, php and mysql. Safe mode has been turned on. To do the task as in subject, I browse some video class to see people how to do it. The simplest method seem to execute external program like ffmpeg in PHP. I've added the path of ffmpeg.exe in the php.ini already: safe_mode_exec_dir ="C:Program Filesffmpeg;" However, it still not works. If I disabled the safe mode. It works. Do I need to add more directory in the safe_mode_exec_dir? Beside using external program ffmpeg.exe, is there any other better way?
Convert Htm Pages To Php
At present the client has a site constructed of htm pages. The pages now need to include a php script to be run at a particular point on them. Do i have to convert all pages from .htm to .php? All htm pages at present are connected to a template. Converting them to php might disable the template connectivity. Is there a way to include the php script on the web pages and maintain template connectivity?
Convert String To An Int
how can i convert a string into an integer? say i have a form that submited 10. i want that converted to integer.
Htmlspecialchars() Won't Convert
I can't get htmlspecialchars() to do it's conversion - eg it won't convert -&- to -& amp;- Does anyone know what could be happening? Code:
|