I found the following PHP script create by webbiedave. Now my question is: How can I specify in strrpos() to search for space or dot? So if I set a maximum string length of 22 and my inout string is: Excluding the appended HTML tag, the output will be: If I have an input of: Excluding the appended HTML tag,
Tag: php
Encoding SQL_Latin1_General_CP1_CI_AS into UTF-8
I’m generating a XML file with PHP using DomDocument and I need to handle asian characters. I’m pulling data from the MSSQL2008 server using the pdo_mssql driver and I apply utf8_encode() on the XML …
Remove all array elements except what I want?
I have controller that takes post parameters from HTML form, it will then send them to model that will insert the array into Cassandra database. It is SQLInjection proof, because it’s NoSQL, however what I’m afraid is that user can just simulate 100k post parameters or just add some that I donR…
PDO MySQL: Use PDO::ATTR_EMULATE_PREPARES or not?
This is what I’ve read so far about PDO::ATTR_EMULATE_PREPARES: PDO’s prepare emulation is better for performance since MySQL’s native prepare bypasses the query cache. MySQL’s native prepare is better for security (preventing SQL Injection). MySQL’s native prepare is better for …
Get my eBay listings with PHP using eBay API
I’ve been reading through the eBay Developer Network and for the life of me can’t figure out how to do the simple task of retrieving all listings from an eBay User (me) via their API. Can anyone help me out on achieving this. Thanks a lot. Edit: I have tried using HTTP method of: But this hasnR…
how to solve double quotes issue in facebook og title property
I have a simple open graph functionality on my facebook app and I post some dynamic text on facebook. Here is my code:
difference between two arrays
I have following two arrays. I want the difference between these two arrays. That is, how can I find the values that do not exist in both arrays? $array1=Array ( [0] => 64 [1] => 98 [2] => …
Insert multiple text inputs with same name, into one cell in MySql
I have multiple inputs On form submit (using $_POST), i want to take all of the inputs (which by the way, we’ll never now how many will be there [dynamic jquery add/remove input form] ) and combine them into one variable, all nicely separated by ^^^. B.T.W, I am using this format to insert into mysql So…
Searching full name or first or last name in MySQL database with first and last name in separate columns
I’m working with an existing database that has first name and last name seperated in the database. I need to create a function that will take one search input and return results. say my database has a structure like…. How could I, using MySql, take a search input that is say ‘Joe Smith’…
PHP recursive array copy
I have a multidimensional array of arrays (source below), where my keys and values are arbitrary strings. I want to create a new array (desired below), where the hierarchy stays the same, but every …