Skip to content

Tag: php

Parsing Wikipedia Page tables issue

Hi I’m trying to parse a Wikipedia document in which there is a table called “infobox biota” with this structure. I’m trying to get the following table data and classes of the following …

PHP date format /Date(1365004652303-0500)/

I am calling an API from where I am getting date /Date(1365004652303-0500)/, I don’t understand what format this is. How is this date format called? I was not sure what to google for such type of format. Can anyone help me out in getting this date in Y-m-d H:i:s format? The API I am calling is on .NET s…

php call class function by string name

How can I call a normal (not static) class function by its name? The below gives an error saying param 1 needs to be a valid callback. I don’t want the function to be static, I want it to be a normal function, and all the examples I’ve seen so far had them static. Answer The callback syntax is a

Sort by date function with variable field name

The problem I’m having is passing the variable field_name to the date_compare function, which can only take two variables due to the usort method. date_compare function must also be wrapped in a variable to avoid redeclaring a function if it is called more than once. m I even going about this the right …

Delete specific characters in text-file php

I have a text like that : I want to delete the , in front of frank or eclipse, it can be any word. My idea is to check if with have a comma before Eclipse:, or accueil: and if with have one then we delete only the comma to have : But how can we delete just one commat

manipulate a result set from laravel eloquent

I’ve just picked up laravel after deciding to move to a php framework. I’m retrieving a result set of articles from a database using an eloquent query: this works fine and results come out as expected. However I now want to change the format of the article date from the mysql date format to anothe…