tutorial
In .NET, we have certain libraries that do pdf manipulation for us.
In PHP, we have open source library for PDF file generation called FPDF. There is an extension of the library: FPDI that allows for manipulating PDF files.
FPDI extracts the content of the pdf as a template, allows us to change the content and then output the changed pdf as a new pdf file.
There is no install. We need to download and include fdpf.php and fdpi.php libraries in our php script as would be demonstrated in the examples below:
1 answers
I have a string that I want to trim or get a subset such that the words are not truncated. But complete words are taken out from the string.
This means for example, I have a string:
<?php
$str = "this is a nice nice work";
?>
Now, if I use a function substrnew($str, 4), I should get 4 words as the output (which means output is "this is a nice"). How do we do that in php?
Read more »
Created by Anonymous
19 weeks 23 hours ago
Tags:
Drupal pagination can be achieved using pager_query API function and tablesort.
I am here mentioning the code snippet that would help create drupal pagination of the output that is sortable with fields.
<?php $sql = 'SELECT cid, first_name, last_name, company, city FROM {clients}'; $limit = 20; $header = array( array('data' => t('Name'), 'field' => 'last_name', 'sort' => 'asc'), array('data' => t('Company'), 'field' => 'company'), array('data' => t('City'), 'field' => 'city') ); $tablesort = tablesort_sql($header);?>
VIM is a powerful editor and used by many geeks across the world. Often, you many want to remove blank lines from your code.
Following is the way to do it:
a. Open vim.
b. Click on 'Escape'
b. Type in the following code:
:%s/^[\ \t]*\n//g
Done. All your empty or blank lines should be gone now.
Here we shall discuss how we are going to submit the form from a jquery program. Earlier, we had discussed how to submit a program using javascript. Now, we shall discuss how to submit a program using Jquery.
Like javascript that provides the submit() method, we have a submit method in Jquery as well.
Jquery Submit() method Example
$('#formid').submit(function() {
alert('I am submitted');
return false;
});
Sometimes, you may need to submit a form programmatically using Javascript in contrast to the standard user way of submitting the form by clicking on the form.
Javascript provides the submit() method to allow for form submit from javascript.
Javascript Submit() method Example 1
document.forms["formname"].submit();
In the code above, formname is the name of the form we want to do the submit on using javascript.
Javascript Submit() method Example 2
<form name="formvar" action="submit.php">
This is a nice Drupal Tutorial for beginners that explains how to start Drupal and learn it. We are slowly adding more Drupal content to it. Also, we assume the users have basic knowledge of PHP and Mysql for them to understand this Tutorial.