Jump to content

jonny512379

New Members
  • Posts

    5
  • Joined

  • Last visited

jonny512379's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you, makes perfect sense now, was just one of them things bugging me, and searching on google for "{} php" returns nothing (well it just ignores the {})
  2. just a quick question i notice in this post and in other post, variables are bing wrapped in {} eg: $daysInMonthy = date('t', strtotime("{$year}-{$month}-01")); //# days in selected month why is this? would this not be the same?: $daysInMonthy = date('t', strtotime("$year-$month-01")); //# days in selected month just asking out of curiosity
  3. Thank you very much, i will try to build a class, starting with what you have explained. Thanks!
  4. Hello All First question post, other than the usual introduction posts. FYI: i am OKish with php, but have never had a need to do the below I basically need to get every date in a given month, including the day of the week (i.e monday, etc). Ideally so i am given an array of dates (i.e with something like "$dates_arr = $calendar_obj->getDatesForMonth($month = 9, $year = 2015);") This is to build a kind of mini calendar. i would have assumed there are some inbuilt php functions/classes for this, but am struggling to find them. Can anyone tell me if there is anything i should be looking at, before i try to build my own class / extend DateTime, etc (as i don't think i need to reinvent the wheel) I would be grateful if anyone could point me in the right direction
  5. Thank you for your reply and the info. much appreciated! I dont mind writing everything (well i may lift a few classes that are already better than i can do for common tasks, etc) as this way i know i understand it all... I am quiet happy to use procedural for some jobs/sites, as i find smaller sites it is better and easier to read/edit later. the "new project" is large and will have lots of repeating features + features will be added at late dates too. it also needs to use a set of different HTML files depending on a few variables; So i am thinking OOP may be the best way to go with this... time will tell... (i also have another "monster" of a site that started small and as fully procedural, but as it has grown the procedural has caused some problems of being repeated lots (with the odd mistake that gets overlooked when updating, etc), so i am slowly changing this to OOP which does make updating it and adding new parts much easier/faster, etc). The new project is a "bed and breakfast" advertising directory and possibly booking system. What i am hoping to initially gain from being a member here (as well as joining in), is for me to build a couple of the main classes (probably property.class.php and user.class.php) then ask for constructive criticism, etc Thanks again Jon
  6. I tried to learn (not seriously) for a few years, but it never really sank in right... I bought a couple of books of Amazon (php/mysql for Dummies and a php/mysql Site Point book (i have since bought more advanced books)). I read them and realized i knew a lot more than i thought!! Once you have the syntax understood (which is easy once it is explained) the logic starts to piece together... PHP reference sites then answers most other questions i find As others say, build a site is the best way to learn i feel; And when selecting the type of site to build deliberately pick one that it slightly above your current abilities!
  7. Hello all, i am Jon from the UK (England) I have been using PHP for a couple of years now (and HTML/CSS for near on 20 years). I started with procedural techniques initially, but now try to use a more OOP style which i can cope with OK. However i am not to sure i user OOP correctly or if i am using them more just as groups of methods with a little more power than functions (to basically neaten things up, keep code out of the HTML and to save on repeating code). I have a large project for a site that is large to start with and will constantly grow, so i'm looking to get this right first time with full OOP. (i am doing a full rebuild of this site from asp/MS-SQL to php/MySQL). i am not sure what, if any, OOP patterns i am using. My own "way" makes sense to me, but im not sure if it follows any standard patterns or if it would be better to do... (again i don't use any frameworks, at present they seem over complicated but that is probably due to my failings in understanding...) Anyway i joined here to help me learn and understand, and will also help others if i am able to. Jon
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.