prosoxi.com | Archive | PHP

Encode your images straight into PHP

Came across this today messing around with WAMP server. The index page it has has some images. I was looking to replace them as i was feeling lazy about creating an Index page

Continue Reading

Posted in PHP0 Comments

How to Scrape Meta Tags From Any Web Page With PHP

A couple of weeks ago I was going to work on a new project, it was a directory-like kind of app. One the things this application had to do was let users add their websites to their profiles, and so the first question came up, “how am going to get their website’s title and meta tags?”.

Continue Reading

Posted in PHP0 Comments

PHP: Simple Try Catch Example

With object orientated languages came the concept of the try-catch block to better manage exceptions and application crashes, and from PHP 5 onwards, the popular web server-side scripting language too adopted this ideology.

Continue Reading

Posted in PHP0 Comments

Translate characters or replace substrings

Is there any function which replaces params in a string? Something like this:?

Code:

$format_str = "My name is %name."; /* this was set in a                                       configuration file - config.php */

$str = xprintf($format_str, array(\'name\' => \'Joe\', \'age\' => 150));               /* above is somewhere in main code */

The expected value of $str after the operation is:

My name is Joe.

Continue Reading

Posted in PHP0 Comments

php Reserved Words

PHP Reserved Words

Continue Reading

Posted in PHP0 Comments

Parse XML With PHP : Read XML File From URL

You can build really cool apps with API’s and most sites will send either JSON or XML back to your app, I prefer JSON actually but some of these API’s will only send XML and, while you can always convert XML to JSON, it’s always better to save that processing time.

Continue Reading

Posted in PHP0 Comments

How to Return More Than One Value From a Function in PHP

Here is a cool trick you might not know if you want to return multiple values from a function and assign them to variables with different names each.

Continue Reading

Posted in PHP0 Comments

10 Ways to Use .htaccess to Speed Up WordPress

Recently I’ve become more and more interested in the .htaccess file as a way to speed up and protect your site. Previously here on WPShout I’ve written an “A to Z of WordPress .htaccess Hacks”, which has been a very popular post, and today we’re going to look at ten easy methods to speed up WordPress with the .htaccess file. Not all of these applyspecifically to WordPress; you could easily apply most of these to any other site.

Continue Reading

Posted in .htaccess, PHP0 Comments

wp Using Permalinks

Permalinks are the permanent URLs to your individual weblog posts, as well as categories and other lists of weblog postings. A permalink is what another weblogger will use to link to your article (or section), or how you might send a link to your story in an e-mail message. The URL to each post should be permanent, and never change — hence permalink.

Continue Reading

Posted in PHP0 Comments

PHP casting operators

$myText = (string)$myVar;

There are more details for string casting and conversion in the Strings section of the PHP manual, including special handling for booleans and nulls.

Continue Reading

Posted in PHP0 Comments

Domain Finder

Domain Finder Tool by Truste.gr

read more for domains

Advertisers

Wedstar all about wedding - gamos - γαμος
Κατασκευή ιστοσελίδων
Domain Names | Hosting

Adds