i am using substr to trim the first 100 characters from the string. however i need a function that can trim a particular number of words, instead of characters from a string?
$trimmed_details = substr($row->details, 0, 200).'...';
is there a built in function to do that?
...
Is it abstract function xxx?
I just made a test which seems to indicate a private method to be virtual too?
class a {
private function test()
{
echo 1;
}
}
class b extends a {
private function test()
{
echo 2;
}
public function call()
{
$this->test();
}
}
$instance = new b;
$instance->call();
The output is 2
...
Common problem, but I'm stumped. Session variables are passing across pages on my local (localhost) deployment, but not on my (www) host. I use a common includes file for each page with this code:
$sessionDomain = "/";
@ini_set("session.cookie_path",$sessionDomain);
$sessionName = "ccSID".md5('/store/');
session_name($sessionName);
se...
Hello,
how can I do this? I have an image 50x50 and I would like to generate one with 100x100, where the original 50x50 will be centered inside of that one. The rest would be filled with "transparent".
Thanks
...
hey guys,
i am trying to convert a date from yyyy-mm-dd to dd-mm-yyyy
however i dont know how the date function requires a timestamp and i cant get a timestamp form this string...
anyone an idea?
thanks
Matthy
...
I am trying to make a search function using the combination of DOM, PHP and XML. I got something up and running but the problem is that my search function will only accept exact terms, on top of this am wondering if the method I picked the most efficient
$searchTerm = "Lupe";
$doc = new DOMDocument();
foreach (file('musicInformation.xml...
Hey
I have some code that downloads an image from a remote server
$data = file_get_contents("$rURL");
I want to then change the quality of this image, but do not want to save it out to a file first, how do I convert $data into an image that I can then use in imagecopyresampled?
Thanks
...
Hi, what would be the xpath for the following:
Find all child nodes with a specific attibute value but starting from a node with a specific attribute value.
This is kind of related to a question I posted earlier about parsing and rdf xml file - I thought I had solved it but not quite yet.
For example I am trying to parse and grab all ...
Do you know any real life examples of actionStack() action helper in Zend Framework?
It seems quite a big overhead to have multiple dispatch loops. Then when it is really needed?
...
I have found a number of articles such as this one that talk about using htaccess to cache images and files on your webserver.
But which is best, why, and what is the best implementation of this?
...
I'm working on my CMS and I want it to log activities by users and other admins.
For example: when new user registers or admin makes a new news post -> update last activity.
I want to know what is the best and easiest way.
...
about my system the university complaint..stud or staff can use this system to complaint.
first user fill the form complaint and submit after submit user can view the complaint.now the problem is the complaint can't display....
this code for user complaint(userCampus.php):
?php // ------------------------------------------------------...
Hi, I am mashing together the Google Maps 2 script with a Wordpress loop so there is a CMS platform for the map data. I have this working fine :
var point = new GLatLng(48.5139,-123.150531);
var marker = createMarker(point,"Lime Kiln State Park",
'<?php $post_id = 182;
$my_post = get_post($post_id);
$mapTitle = $my_post->post_title;
...
I have a text string that has been doctored to be web safe URLs i.e. non alphanumeric's are converted to "_".
What I want to do is search for the original name before it was converted, this means that I need some kind of wild card search i.e.
What I have
test__mytest
With wildcards
test??mytest
The string I would find with the wi...
hai guys...
i .ve the problem that i cannot be recovered yet...
i have one form where admin need to approve or reject the booking request...
i've set the b_status field in table usage IN PROCESS default value...
i want to update the b_status value BOOKING APPROVED when user click APPROVE button..
otherwise, the b_status will update the v...
What do you think, should I use ORM like Propel or Doctrine?
For a new PHP Project. Are there any performance issues?
...
I'm trying to make a PHP regex to extract functions from php source code. Until now i used a recursive regex to extract everything between {} but then it also matches stuff like if statements. When i use something like:
preg_match_all("/(function .(.))({([^{}]+|(?R))*})/",$this->data,$matches2);
It doesn't work when there is more than 1...
There are 2 Models: Project & Category that are bind with HABTM relationship.
I would like to perform a search from projects controller that can do the following:
FIND all DISTINCT Project.scedule WHERE Category.slug != 'uncategorised'
Apologies for the syntax, I'm no sequel expert.
What I have managed to do is to retrieve all projec...
I have a link in my system as displayed above; 'viewauthorbooks.php?authorid=4' which works fine and generates a page displaying the books only associated with the particular author. However I am implementing another feature where the user can sort the columns (return date, book name etc) and I am using the ORDER BY SQL clause. I have th...
The following is 2 different definitions of the problem:
How can I process 2 arrays so that I can keep the data of duplicate array[key] values.
I have arrays A and B.
I want to create array C with the children that their id/key values exist in both A and B arrays.
Thank you
...